diff --git a/src/components/richTextInput.js b/src/components/richTextInput.js index 0bb4b1462..58f3b0ac7 100644 --- a/src/components/richTextInput.js +++ b/src/components/richTextInput.js @@ -415,10 +415,7 @@ }; const renderLeaf = useCallback((props) => , []); - const editor = React.useMemo( - () => withHistory(withReact(createEditor())), - [], - ); + const [editor] = useState(() => withReact(withHistory(createEditor()))); const parsed = new DOMParser().parseFromString( useText(valueProp), 'text/html', @@ -438,21 +435,6 @@ ]; }); - if (isDev) { - useEffect(() => { - Transforms.delete(editor, { - at: { - anchor: Editor.start(editor, []), - focus: Editor.end(editor, []), - }, - }); - Transforms.insertNodes(editor, deserialize(parsed.body)); - Transforms.delete(editor, { - at: Editor.start(editor, [0]), - }); - }, [valueProp]); - } - const handleListdepth = (listKind, key, event) => { const isList = isBlockActive(editor, listKind, 'type'); if (isList) {