mirror of https://github.com/fantasticit/think.git
tiptap: fix render flow
This commit is contained in:
parent
43f83ff243
commit
67410ce2a4
|
@ -96,14 +96,16 @@ export const FlowWrapper = ({ editor, node, updateAttributes }) => {
|
||||||
const setMxgraph = useCallback(
|
const setMxgraph = useCallback(
|
||||||
(div) => {
|
(div) => {
|
||||||
$container.current = div;
|
$container.current = div;
|
||||||
|
if (!isEditorReady) return;
|
||||||
render(div);
|
render(div);
|
||||||
},
|
},
|
||||||
[render]
|
[isEditorReady, render]
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (!isEditorReady) return;
|
||||||
render($container.current);
|
render($container.current);
|
||||||
}, [graphData, render]);
|
}, [isEditorReady, graphData, render]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NodeViewWrapper className={cls(styles.wrap, isActive && styles.isActive)}>
|
<NodeViewWrapper className={cls(styles.wrap, isActive && styles.isActive)}>
|
||||||
|
|
Loading…
Reference in New Issue