diff --git a/app/editor/index.tsx b/app/editor/index.tsx index ccd78d4a3..0154691fd 100644 --- a/app/editor/index.tsx +++ b/app/editor/index.tsx @@ -457,11 +457,14 @@ export class Editor extends React.PureComponent< state: this.createState(this.props.value), editable: () => !this.props.readOnly, nodeViews: this.nodeViews, - dispatchTransaction(transaction) { + dispatchTransaction(this: EditorView, transaction) { + if (this.isDestroyed) { + return; + } + // callback is bound to have the view instance as its this binding - const { state, transactions } = ( - this.state as EditorState - ).applyTransaction(transaction); + const { state, transactions } = + this.state.applyTransaction(transaction); this.updateState(state);