Remove im ready message (#843)

This commit is contained in:
Krzysztof Wolski 2020-11-20 10:44:50 +01:00 committed by GitHub
parent e2e5f7f7a5
commit 439e5b249e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -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<RichTextEditorProps> = ({
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<RichTextEditorProps> = ({
// 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);

View file

@ -1,4 +1,5 @@
import EditorJS, {
LogLevels,
OutputData,
ToolConstructable,
ToolSettings
@ -54,6 +55,7 @@ const RichTextEditorContent: React.FC<RichTextEditorContentProps> = ({
editor.current = new EditorJS({
data,
holder: editorContainer.current,
logLevel: "ERROR" as LogLevels,
onReady,
readOnly: true,
tools
@ -65,7 +67,6 @@ const RichTextEditorContent: React.FC<RichTextEditorContentProps> = ({
// Rerender editor only if changed from undefined to defined state
[data === undefined]
);
React.useEffect(() => editor.current?.destroy, []);
return (
<div