Memoize NodeWrapper and EdgeWrapper

This commit is contained in:
peterkogo
2025-10-01 11:33:34 +02:00
parent 736eba4d6a
commit 0c1ad4c861
5 changed files with 20 additions and 6 deletions

View File

@@ -239,6 +239,16 @@ const StressFlow = () => {
<button onClick={remount}>re-mount</button>
<button onClick={updatePos}>change pos</button>
<button onClick={updateElements}>update elements</button>
<button
onClick={() => {
setNodes((nds) => [
...nds,
{ id: (nds.length + 1).toString(), position: { x: 0, y: 0 }, data: { label: `Node ${nds.length + 1}` } },
]);
}}
>
Add element
</button>
</Panel>
</ReactFlow>
);