refactor(node): pass width and height dep to style memo

This commit is contained in:
moklick
2021-11-01 18:12:53 +01:00
parent 3f992db54a
commit 74e860587c
2 changed files with 2 additions and 4 deletions
+2
View File
@@ -90,6 +90,8 @@ export default (NodeComponent: ComponentType<NodeComponentProps>) => {
onMouseMove,
onMouseLeave,
isParentNode,
width,
height,
]
);
-4
View File
@@ -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) {