Yadong (Adam) Zhang
Yadong (Adam) Zhang
try `createEmpty(decorator)` and `EditorState.push()`: https://github.com/zhyd1997/Eorg/blob/89b02a6e4f6a235691f9b361c942c0a3685c246c/src/components/Editor/index.tsx#L54 https://github.com/zhyd1997/Eorg/blob/89b02a6e4f6a235691f9b361c942c0a3685c246c/src/components/Editor/index.tsx#L119
I found no duplications, maybe you have fixed it.
You not used draftjs but [react-draft-wysiwg](https://github.com/jpuri/react-draft-wysiwyg), maybe you can submit an issue on that repo.
Some advice in `Draft.js` file: `onAddLink`: ```js // replace let newState = EditorState.createWithContent(textWithEntity, decorator); // with let newState = EditorSate.push(editorState, textWithEntity, "insert-characters"); ``` `Draft`: ```jsx // replace const [editorState, setEditorState]...
Sorry, typo error, `EditorSate` should be `EditorState`.
And check your `focusEditor` fn, `ref.current.focus()`, right?
Checkout your second `useEffect`, comment it and rerun
Pleasure
Close this please
PR: #19004