Closed NawarA closed 1 month ago
Thanks for helping with the 12 release. We will try to find out what is wrong here.
I can't reproduce this. Can you create a codesandbox for this? Maybe you can use this as a starting point https://codesandbox.io/p/sandbox/reactflow-reactive-flow-34lk98?file=/src/Flow.tsx
I setup a codesandbox env, but I'm unable to replicate the bug so far.
A few observations:
updateNodeData
calls at the same exact same millisecond the bug occurs, but if I use a settimeout to space updateNodeData
calls by about 100ms, the problem disappears. I believe that I am experiencing the same issue in next.14. For me, the issue occurs when connecting nodes in parallel. I've included a codesandbox below which demonstrates that only 1 path from the "Hello" textbox gets updated. A few things I've noticed, when connecting nodes in the following order A->B->C->D and A->E->F, G, with node A connected to both B and E:
https://codesandbox.io/p/sandbox/reactflow-reactive-flow-forked-c87mwh
Thanks again for the very detailed report! updateNode
and updateNodeData
was indeed a bit broken. This should be fixed in 12.0.0-next.16.
Describe the Bug
updateNodeData works consistently in
12.0.0-next.11
Consistently means it always works as expected.
So
Ever since
12.0.0-next.12
the commandupdateNodeData( id, data )
no longer updates the node data property consistently.So
When I downgrade from 12.0.0-next.14 to 12.0.0-next.11, the update function works again.
Your Example Website or App
No response
Steps to Reproduce the Bug or Issue
See code samples above...sorry I didn't create a separate repo with completely isolated code, but hopefully being to replicate the error is easy for you...just run the
updateNodeData( id, data )
.By the way, in case it's helpful to mention, I usually update multiple nodeId's during the same execution, not sure if that's related to the root of the problem, but thought I'd mention it, as its part my setup of the issue.
Expected behavior
Screenshots or Videos
No response
Platform
Additional context
No response