question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Major lag when dragging nodes with react 18 / v10.2

See original GitHub issue

Describe 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

  1. 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:

https://user-images.githubusercontent.com/24462089/166427288-07ad67ef-abd2-4973-85db-3e9c7d46456a.mp4

React 18 / v10.2:

https://user-images.githubusercontent.com/24462089/166427308-5bf9eaa2-eec5-420f-8f1f-436f5e2f4d74.mp4

Platform

  • OS: Windows 11
  • Browser: Chrome
  • Version: 100.0

Additional context

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:36 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
moklickcommented, May 23, 2022

released in v10.3.0

2reactions
stanislav-grincommented, May 3, 2022

I had the same behavior when there was an additional wrapper between ReactFlowProvider and ReactFlow components, such as:

<ReactFlowProvider>
  <MyOwnWrapper> // some custom context provider
    <ReactFlow .../>
  </MyOwnComponent>
</ReactFlowProvider>

When I reworked code so that become

<ReactFlowProvider>
  <ReactFlow .../>
</ReactFlowProvider>

the issue has gone.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found