diff --git a/src/components/RichTextEditor/RichTextEditor.tsx b/src/components/RichTextEditor/RichTextEditor.tsx index cc17b8de8..addc34fb6 100644 --- a/src/components/RichTextEditor/RichTextEditor.tsx +++ b/src/components/RichTextEditor/RichTextEditor.tsx @@ -1,4 +1,4 @@ -import EditorJS, { OutputData } from "@editorjs/editorjs"; +import EditorJS, { LogLevels, OutputData } from "@editorjs/editorjs"; import FormControl from "@material-ui/core/FormControl"; import FormHelperText from "@material-ui/core/FormHelperText"; import InputLabel from "@material-ui/core/InputLabel"; @@ -40,6 +40,7 @@ const RichTextEditor: React.FC = ({ editor.current = new EditorJS({ data, holder: editorContainer.current, + logLevel: "ERROR" as LogLevels, onChange: async api => { const savedData = await api.saver.save(); onChange(savedData); @@ -61,7 +62,6 @@ const RichTextEditor: React.FC = ({ // Rerender editor only if changed from undefined to defined state [data === undefined] ); - React.useEffect(() => editor.current?.destroy, []); React.useEffect(() => { if (editor.current?.readOnly) { editor.current.readOnly.toggle(disabled); diff --git a/src/components/RichTextEditor/RichTextEditorContent.tsx b/src/components/RichTextEditor/RichTextEditorContent.tsx index 37ddf24e3..c6772743d 100644 --- a/src/components/RichTextEditor/RichTextEditorContent.tsx +++ b/src/components/RichTextEditor/RichTextEditorContent.tsx @@ -1,4 +1,5 @@ import EditorJS, { + LogLevels, OutputData, ToolConstructable, ToolSettings @@ -54,6 +55,7 @@ const RichTextEditorContent: React.FC = ({ editor.current = new EditorJS({ data, holder: editorContainer.current, + logLevel: "ERROR" as LogLevels, onReady, readOnly: true, tools @@ -65,7 +67,6 @@ const RichTextEditorContent: React.FC = ({ // Rerender editor only if changed from undefined to defined state [data === undefined] ); - React.useEffect(() => editor.current?.destroy, []); return (