fix: check for destroyed editor before creating node views in react

This commit is contained in:
Philipp Kühn
2021-06-24 19:59:06 +02:00
parent 84d732f7a5
commit 44e47222a0

View File

@@ -64,7 +64,11 @@ export class PureEditorContent extends React.Component<EditorContentProps, Edito
editor.contentComponent = this editor.contentComponent = this
// TODO: alternative to setTimeout? // TODO: alternative to setTimeout?
setTimeout(() => editor.createNodeViews(), 0) setTimeout(() => {
if (!editor.isDestroyed) {
editor.createNodeViews()
}
}, 0)
} }
} }