Category : draftjs

While working on my app I noticed that Korean inputs are not registered until a non-Korean input(space, arrow keys, return, a mouse click) are made. I tested this with a simple console.log in componentDidUpdate, which returns false until said non-Korean inputs. componentDidUpdate() { const test = this.props.editorState.getCurrentContent(); console.log(test.hasText()); } A functionality of my app requires ..

Read more

There is a similar question raised here: Uncaught ReferenceError: global is not defined at Object../node_modules/fbjs/lib/setImmediate.js And there are two answers on that question that both seem confident they can solve it. The problem for me is–no explanation of how to implement the answers is given. Basically, I have an electron app incorporating React, everything works ..

Read more

Like the title says, I’m trying to implement img rendering I DraftJS. This is how I’m trying to do it: export const blockRenderer = block => { if (block.getType() === "atomic") { return { component: ImageBlock, editable: true }; } return null; } const ImageBlock = (props) => { const entity = props.contentState.getEntity(props.block.getEntityAt(0)); const {src} ..

Read more