diff --git a/apps/web/src/components/editor/react-quill.js b/apps/web/src/components/editor/react-quill.js index dd8cd6444..9f76ea5bf 100644 --- a/apps/web/src/components/editor/react-quill.js +++ b/apps/web/src/components/editor/react-quill.js @@ -173,7 +173,7 @@ export default class ReactQuill extends Component { ); } - onQuillInitialized(); + if (onQuillInitialized) onQuillInitialized(); } componentWillUnmount() { diff --git a/apps/web/src/components/spliteditor/index.js b/apps/web/src/components/spliteditor/index.js index 6fde21c95..500e8e7b2 100644 --- a/apps/web/src/components/spliteditor/index.js +++ b/apps/web/src/components/spliteditor/index.js @@ -43,12 +43,13 @@ function SplitEditor(props) { if (!conflictedNote || !localDelta || !remoteDelta) return null; return ( - + {conflictedNote.title} - + @@ -86,6 +92,7 @@ function SplitEditor(props) { - + import("../editor/react-quill")); function SimpleEditor(props) { const { delta, container, id, pref } = props; - useEffect(() => { - const toolbar = document.querySelector(`${container} .ql-toolbar.ql-snow`); - if (toolbar) toolbar.remove(); - }, [container]); + return ( }> { + const toolbar = document.querySelector( + `${container} .ql-toolbar.ql-snow` + ); + if (toolbar) toolbar.remove(); + }} placeholder="Type anything here" container={container} />