From a4a2205d11eaad663b23b28257b206401c9337b6 Mon Sep 17 00:00:00 2001 From: fantasticit Date: Mon, 2 May 2022 17:59:47 +0800 Subject: [PATCH] tiptap: fix https://github.com/ueberdosis/tiptap/issues/1451 --- packages/client/src/tiptap/index.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/client/src/tiptap/index.ts b/packages/client/src/tiptap/index.ts index 303b5c9f..e975ea58 100644 --- a/packages/client/src/tiptap/index.ts +++ b/packages/client/src/tiptap/index.ts @@ -1,3 +1,10 @@ +import { EditorView } from 'prosemirror-view'; +// @see https://github.com/ueberdosis/tiptap/issues/1451 +EditorView.prototype.updateState = function updateState(state) { + if (!this.docView) return; // This prevents the matchesNode error on hot reloads + this.updateStateInner(state, this.state.plugins != state.plugins); +}; + export { getSchema } from '@tiptap/core'; export * from './react'; export * from './start-kit';