Major lag when dragging nodes with react 18 / v10.2
See original GitHub issueDescribe the Bug
Upgrading to React 18 and v10.2 of React Flow introduced noticeable, major lag when dragging nodes, as can be seen in the videos below.
In this example, onNodesChange
and onEdgesChange
are implemented as the default (calling setNodes
and setEdges
) and onNodesDrag
is not implemented, so there shouldn’t be any major logic going on on drag that could introduce this lag. I’m happy to add any code or context you might want but I’m not sure what else could be helpful here.
No other visible regressions were found when doing this update.
Your Example Website or App
No response
Steps to Reproduce the Bug or Issue
- Update react and react-dom to v18 and update react-flow-renderer to v10.2
Expected behavior
I expected dragging nodes to be as fluent as when using v17/v10.1.
Screenshots or Videos
React 17 / v10.1:
React 18 / v10.2:
Platform
- OS: Windows 11
- Browser: Chrome
- Version: 100.0
Additional context
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:36 (9 by maintainers)
Top Results From Across the Web
Dragging nodes over elements outside of the graph causes ...
In bigger graphs (can happen very easily in production graphs that contain a lot of data but also happens when there are many...
Read more >lag while dragging element - javascript - Stack Overflow
The problem is that there's a lot of lag in dragging the "note" element. The "sticky note" itself is a very lite weight...
Read more >Firebase Android SDK Release Notes - Google
Cloud Functions for Firebase Client SDK version 20.2.1. Updated dependency of firebase-iid to its latest version (v21.1.0).
Read more >Synchro Manual
2-18. Select Intersection . ... Allow Lead/Lag Optimize? ... Drag the intersection, or node, to the new location and click the left mouse...
Read more >Untitled
Versicherungsbroker courtage, Pista la colonia panama, Manhattan towers 2 mersin, ... Lanyard ring leatherman charge, Drag back in real football 2012, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
released in v10.3.0
I had the same behavior when there was an additional wrapper between ReactFlowProvider and ReactFlow components, such as:
When I reworked code so that become
the issue has gone.