From 74e860587cbc574c03c1f038a9ff3da65a9bd337 Mon Sep 17 00:00:00 2001 From: moklick Date: Mon, 1 Nov 2021 18:12:53 +0100 Subject: [PATCH] refactor(node): pass width and height dep to style memo --- src/components/Nodes/wrapNode.tsx | 2 ++ src/utils/graph.ts | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/components/Nodes/wrapNode.tsx b/src/components/Nodes/wrapNode.tsx index 45fe388c..23912700 100644 --- a/src/components/Nodes/wrapNode.tsx +++ b/src/components/Nodes/wrapNode.tsx @@ -90,6 +90,8 @@ export default (NodeComponent: ComponentType) => { onMouseMove, onMouseLeave, isParentNode, + width, + height, ] ); diff --git a/src/utils/graph.ts b/src/utils/graph.ts index 179db8f7..cdcc2d1f 100644 --- a/src/utils/graph.ts +++ b/src/utils/graph.ts @@ -293,10 +293,6 @@ function applyChanges(changes: NodeChange[] | EdgeChange[], elements: any[]): an const initElements: any[] = []; return elements.reduce((res: any[], item: any) => { - if (item.childNodes) { - item.childNodes = applyChanges(changes, item.childNodes); - } - const currentChange = changes.find((c) => c.id === item.id); if (currentChange) {