What could create a null docView?

Hi All,

I’m fighting a bug related to applying transactions from external components. We’re using collab and rebasing edits on the client side.

The bug flairs up on the second call, when we perform the rebase step and try to re update the editor state: const newEditorState = editorState.apply(tr) this.view.updateState(newEditorState)

Upon debugging, within updateState, an error is thrown at this line because the docView is null.

var updateDoc = this.redraw || !this.docView.matchesNode(state.doc, outerDeco, innerDeco);

The error message is: image

Any idea what could be setting the docView to null?

Calling .destroy() on an editor does that. Nothing else that I’m aware of.

Ah! That’s it - we’re destroying it in a react lifecycle method, and then trying to rebase.

Thanks Marjin!