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.

Maximum update depth exceeded

See original GitHub issue

Describe the Bug

using useNodes, useEdges hooks causing the Maximum update depth exceeded react error. Reproduced this by repositioning the nodes.

Your Example Website or App

https://codesandbox.io/s/reactflow-9wb79d?file=/App.js

Steps to Reproduce the Bug or Issue

  1. Go to this codesanbdox link
  2. Reposition the nodes

Expected behavior

No error on repositioning the nodes when using useNodes hook

Screenshots or Videos

https://user-images.githubusercontent.com/91449579/202366294-4835fabc-9474-4846-b38d-006ff156dfa4.mp4

Platform

  • OS: macOS
  • Browser: Brave
  • Version: 1.45.123

Additional context

No response

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
nraskoti92commented, Nov 17, 2022

Ah missed this guide. For the current report then we can conclude it occurred due to bad state management. Closing this report. Thank you so much @moklick for the guide.

0reactions
moklickcommented, Nov 17, 2022

Did you see the state management guide. The important thing is, that you implement the onNodesChange, onEdgesChange and onConnect in your store. Then there is no need to sync states, because the one source of truth is your store.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ReactJS: Maximum update depth exceeded error
Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate.
Read more >
Fix the "Maximum Update Depth Exceeded" Error in React
Fix the "Maximum Update Depth Exceeded" Error in React ... React is an excellent framework, but it can have some tricky “gotchas.” One...
Read more >
Maximum update depth exceeded warning in React
Maximum update depth exceeded warning in React ... This warning can often happen when a component sets the state inside the useEffect hook....
Read more >
Maximum update depth exceeded. This can happen when a ...
Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate.
Read more >
Maximum update depth exceeded problem without using ...
"Warning: Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have ...
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