"Maximum update depth exceeded" error when resizing in Chrome
See original GitHub issueHi, We bought 2 license keys and have been enjoying the Fullcalendar library so far. Our project uses the React version v5.3.1 with the Resource Timeline and Timeline plugins.
However today, we noticed that resizing the window leads to an error Maximum update depth exceeded
.
This reported bug https://github.com/fullcalendar/fullcalendar/issues/5606 mentioned something very similar and was already fixed in v5.2.0.
Reduced Test Case
Code Sandbox reduced test case.
Bug Description
- using chrome
- increase/decrease the browser window width
- notice the app crashing with a
Uncaught Error: Maximum update depth exceeded
Screenshots
Thank you.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:12 (3 by maintainers)
Top Results From Across the Web
Getting maximum update depth exceeded on small screen size
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
One quick solution is to move the function inside the useEffect hook. function App() { const [views ...
Read more >× Unhandled Rejection (Error): Maximum update depth exceeded ...
Error : Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits ...
Read more >Usage and limits | Firestore - Firebase
Use this guide to understand Cloud Firestore limits, and see Cloud Firestore Pricing for a full, ... Maximum depth of fields in a...
Read more >@fullcalendar/luxon2 | Yarn - Package Manager
... with expanding height (#5792); fixed: locales not working in IE11 (#6790) ... dateSet, and "Maximum update depth exceeded error" (#5935, react-185) ...
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
@arshaw I can also confirm problem with this (fullcalendar & plugins in newest versions
5.11.0
). I was able to debug the code and found this: https://github.com/fullcalendar/fullcalendar-scheduler/blob/master/scrollgrid/src/ClippedScroller.tsx#L93-L97This line is doing a lot of re-renders of
ClippedScroller
component, mostly becauseisPropsEqual
is comparing really big props objects, and it’s returningfalse
even if objects probably should be equal https://github.com/fullcalendar/fullcalendar/blob/master/packages/common/src/util/object.ts#L103-L105my proposition is to instead comparing whole
props
, maybe we should compare only those values of those objects which should triggerthis.handleSizing()
For example:
this will reduce a lot unnecessary re-renders of
ClippedScroller
component, and can fix problem with “Maximum update depth exceeded”Hi @arshaw ! Thanks for the workaround idea. I just updated my CodeSandbox example with latest 5.4.0 https://codesandbox.io/s/pedantic-architecture-o43ni?file=/src/App.js and I can still reproduce it on Chrome. Although I will agree, that the windowResizeDelay prop does somehow mitigate the crash.
I can also understand why this is hard to debug and fix.
In our usage of the Fullcalendar library, we extend each rows with our own components using the eventContent hook. We have ~100 rows, maybe more. I hope that even with lots of components to render on screen and your
windowResizeDelay
will do the trick.If not, I’ll probably come back in this thread with an updated reduced test case 😃
Thanks a lot and happy hacking ⌨!