State: nodes incorrectly positioned on rerender
See original GitHub issuei calculate node positioning from my server and pass those nodes directly to a Graph component.
when my nodes initially render, they are positioned correctly, but if i later pass a new set of nodes, the positioning is wrong – the tree appears much larger and less dense, it’s as if the x/y position for each node gets multiplied by some number. if i then refresh my page, my nodes appear positioned correctly again.
i understand react-flow manages internal position state - i’m wondering if something isn’t getting cleared on rerender?
i suspect i could get around the problem if i had the ability to reset position state before passing Graph new elements.
in case you aren’t sure what’s going on, i’ll keep poking to see if i can identify the root cause.
thanks!
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (5 by maintainers)

Top Related StackOverflow Question
amazing - it’s all working great. thank you!
@moklick thank you! great lib!