From 94f3fd7981027e5e21c44dc2893076730bd5466a Mon Sep 17 00:00:00 2001 From: fantasticit Date: Wed, 11 May 2022 21:25:02 +0800 Subject: [PATCH] tiptap: fix render flow --- packages/client/src/tiptap/core/wrappers/flow/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/client/src/tiptap/core/wrappers/flow/index.tsx b/packages/client/src/tiptap/core/wrappers/flow/index.tsx index ab0e5601..15e1c959 100644 --- a/packages/client/src/tiptap/core/wrappers/flow/index.tsx +++ b/packages/client/src/tiptap/core/wrappers/flow/index.tsx @@ -20,6 +20,7 @@ export const FlowWrapper = ({ editor, node, updateAttributes }) => { const $container = useRef(); const graphData = useMemo(() => { + if (!data) return null; const content = data.replace(//gs, '').trim(); const config = JSON.stringify({ 'lightbox': false, @@ -90,7 +91,9 @@ export const FlowWrapper = ({ editor, node, updateAttributes }) => {
-
+ {graphData && ( +
+ )}