fix(nodes): handle isHidden on start closes #506

This commit is contained in:
moklick
2020-09-14 12:16:31 +02:00
parent ce1ddcb681
commit 3693602cf8
2 changed files with 2 additions and 4 deletions
-2
View File
@@ -27,8 +27,6 @@ const HiddenFlow = () => {
);
}, [isHidden]);
console.log(elements);
return (
<ReactFlow elements={elements} onConnect={onConnect}>
<MiniMap />
+2 -2
View File
@@ -153,7 +153,7 @@ export default (NodeComponent: ComponentType<NodeComponentProps>) => {
);
useEffect(() => {
if (nodeElement.current) {
if (nodeElement.current && !isHidden) {
updateNodeDimensions({ id, nodeElement: nodeElement.current });
const resizeObserver = new ResizeObserver(() => {
@@ -172,7 +172,7 @@ export default (NodeComponent: ComponentType<NodeComponentProps>) => {
}
return;
}, [id]);
}, [id, isHidden]);
if (isHidden) {
return null;