refactor(node): pass width and height dep to style memo
This commit is contained in:
@@ -90,6 +90,8 @@ export default (NodeComponent: ComponentType<NodeComponentProps>) => {
|
|||||||
onMouseMove,
|
onMouseMove,
|
||||||
onMouseLeave,
|
onMouseLeave,
|
||||||
isParentNode,
|
isParentNode,
|
||||||
|
width,
|
||||||
|
height,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -293,10 +293,6 @@ function applyChanges(changes: NodeChange[] | EdgeChange[], elements: any[]): an
|
|||||||
const initElements: any[] = [];
|
const initElements: any[] = [];
|
||||||
|
|
||||||
return elements.reduce((res: any[], item: 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);
|
const currentChange = changes.find((c) => c.id === item.id);
|
||||||
|
|
||||||
if (currentChange) {
|
if (currentChange) {
|
||||||
|
|||||||
Reference in New Issue
Block a user