Merge branch 'main' into feat/hooks

This commit is contained in:
moklick
2022-08-16 14:26:23 +02:00
11 changed files with 60 additions and 101 deletions
@@ -10,15 +10,10 @@ function useUpdateNodeInternals(): UpdateNodeInternals {
const updateNodeDimensions = useStore(selector);
return useCallback<UpdateNodeInternals>((id: string) => {
const { domNode } = store.getState();
if (!domNode) {
return;
}
const nodeElement = domNode.querySelector(`.react-flow__node[data-id="${id}"]`) as HTMLDivElement;
const nodeElement = store.getState().domNode?.querySelector(`.react-flow__node[data-id="${id}"]`) as HTMLDivElement;
if (nodeElement) {
updateNodeDimensions([{ id, nodeElement, forceUpdate: true }]);
requestAnimationFrame(() => updateNodeDimensions([{ id, nodeElement, forceUpdate: true }]));
}
}, []);
}