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.

Select: Warning Maximum update depth exceeded.

See original GitHub issue

Updated to the latest v2.17 and am seeing the following warning when opening the Drop on a Select component;

Warning: Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render. at InfiniteScroll (https://p86yu.csb.app/node_modules/grommet/es6/components/InfiniteScroll/InfiniteScroll.js:21:23)

Here’s a Codesandbox reproducing the issue.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
haloclinecommented, Mar 23, 2021

These two useEffects seem to be entering into an infinite loop. Each have dependencies of pendingLength which gets set in each, which then satisfies the dependency condition as well as the checks within the useEffects. Seems like we need to add an additional condition around pendingLength. Screen Shot 2021-03-23 at 11 46 26 AM

0reactions
MikeKingdomcommented, Oct 11, 2021

This may have been fixed by #5636 . Select uses InfiniteScroll for its options and had an infinite recursion with onMore when the list of items was empty.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React warning Maximum update depth exceeded
I'm getting this warning: Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either ...
Read more >
Fix the "Maximum Update Depth Exceeded" Error in React
One quick solution is to move the function inside the useEffect hook. function App() { const [views ...
Read more >
React - maximum update depth exceeded - CodeProject
<pre>index.js:1 Warning: Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect ...
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 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