From a066a145371211f011edc35aec1b922cc59479a7 Mon Sep 17 00:00:00 2001 From: fantasticit Date: Mon, 8 Aug 2022 19:09:52 +0800 Subject: [PATCH] tiptap: fix render doc --- packages/client/src/tiptap/core/index.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/client/src/tiptap/core/index.tsx b/packages/client/src/tiptap/core/index.tsx index 56edec90..ec6459cd 100644 --- a/packages/client/src/tiptap/core/index.tsx +++ b/packages/client/src/tiptap/core/index.tsx @@ -36,15 +36,13 @@ export const useEditor = (options: Partial = {}, deps: Dependency setEditor(instance); - if (!options.editable) { - instance.on('transaction', () => { + instance.on('transaction', () => { + requestAnimationFrame(() => { requestAnimationFrame(() => { - requestAnimationFrame(() => { - forceUpdate(); - }); + forceUpdate(); }); }); - } + }); return () => { instance.destroy();