Forced scrollable Tabs nested in Toolbar causes 'Maximum update depth exceeded.' error
See original GitHub issueWhen adding forced scrollable Tabs as children of the Toolbar component an Invariant Violation occurs.
The following error output is from the Link: codesandbox example:
https://m9v2919yop.codesandbox.io/node_modules/fbjs/lib/invariant.js:42:15
scheduleWork$1
https://m9v2919yop.codesandbox.io/node_modules/react-dom/cjs/react-dom.development.js:16222:11
Object.enqueueSetState
https://m9v2919yop.codesandbox.io/node_modules/react-dom/cjs/react-dom.development.js:11300:5
Tabs.Component.setState
https://m9v2919yop.codesandbox.io/node_modules/react/cjs/react.development.js:270:16
at Tabs._this.updateScrollButtonState (https://m9v2919yop.codesandbox.io/node_modules/
material-ui/core/Tabs/Tabs.js:257:17
at Tabs.componentDidUpdate (https://m9v2919yop.codesandbox.io/node_modules/
material-ui/core/Tabs/Tabs.js:288:12
commitLifeCycles
https://m9v2919yop.codesandbox.io/node_modules/react-dom/cjs/react-dom.development.js:14370:22
commitAllLifeCycles
https://m9v2919yop.codesandbox.io/node_modules/react-dom/cjs/react-dom.development.js:15463:7
HTMLUnknownElement.callCallback
https://m9v2919yop.codesandbox.io/node_modules/react-dom/cjs/react-dom.development.js:100:14
Object.invokeGuardedCallbackDev
https://m9v2919yop.codesandbox.io/node_modules/react-dom/cjs/react-dom.development.js:138:16
invokeGuardedCallback
https://m9v2919yop.codesandbox.io/node_modules/react-dom/cjs/react-dom.development.js:187:29
commitRoot
https://m9v2919yop.codesandbox.io/node_modules/react-dom/cjs/react-dom.development.js:15604:7
completeRoot
https://m9v2919yop.codesandbox.io/node_modules/react-dom/cjs/react-dom.development.js:16619:34
performWorkOnRoot
https://m9v2919yop.codesandbox.io/node_modules/react-dom/cjs/react-dom.development.js:16564:9
performWork
https://m9v2919yop.codesandbox.io/node_modules/react-dom/cjs/react-dom.development.js:16483:7
performSyncWork
https://m9v2919yop.codesandbox.io/node_modules/react-dom/cjs/react-dom.development.js:16455:3
requestWork
https://m9v2919yop.codesandbox.io/node_modules/react-dom/cjs/react-dom.development.js:16355:5
scheduleWork$1
https://m9v2919yop.codesandbox.io/node_modules/react-dom/cjs/react-dom.development.js:16219:11
Object.enqueueSetState
https://m9v2919yop.codesandbox.io/node_modules/react-dom/cjs/react-dom.development.js:11300:5
Tabs.Component.setState
https://m9v2919yop.codesandbox.io/node_modules/react/cjs/react.development.js:270:16
at Tabs._this.updateScrollButtonState (https://m9v2919yop.codesandbox.io/node_modules/
material-ui/core/Tabs/Tabs.js:257:17
at eval (https://m9v2919yop.codesandbox.io/node_modules/
material-ui/core/Tabs/Tabs.js:127:13
later
https://m9v2919yop.codesandbox.io/node_modules/debounce/index.js:28:23
- This is a v1.x issue.
- I have searched the issues of this repository and believe that this is not a duplicate.
Expected Behavior
Able to add forced scrollable Tabs as a child of the Toolbar component without Invariant error.
Current Behavior
When clicking through the scroll buttons and tabs the browser becomes unresponsive and throws the following error:
Invariant Violation
Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside
componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent
infinite loops.
Steps to Reproduce
Link: codesandbox example
This bug is consistently reproducible but the exact number of steps is unpredictable. Within the codesandbox.io example using Chrome
- Click a scroll button
- Click a few tabs
- Click the other scroll button
- Click a few tabs
- Repeat until the error is thrown. It usually only takes a few cycles.
Context
I am trying to add forced scrollable Tabs to my applications Toolbar component.
Your Environment
Tech | Version |
---|---|
Material-UI | v1.5.0 |
React | v16.3.2 |
browser | Chrome Version 68.0.3440.106 (Official Build) (64-bit) |
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:14 (2 by maintainers)
Top Results From Across the Web
Forced scrollable Tabs nested in Toolbar causes 'Maximum ...
Invariant Violation Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or ...
Read more >React getting Maximum update depth exceeded error
Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate.
Read more >PySimpleGUI
PSG solved the GUI problem, but you still have to make an application ... Note that the default max number of lines before...
Read more >ScrollView - Android Developers
android:animateLayoutChanges, Defines whether changes in layout (caused by adding and ... React to the successful claiming of a nested scroll operation.
Read more >Lightning Aura Components Developer Guide
we showed you how to surface a component via a tab in Lightning Experience and the Salesforce app, you can take this tutorial...
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
I’m closing this as a duplicate of #13699. This should now be fixed.
@Quantumplation in short, i had a bad push which caused the “tab contents” to exceed the “tab container”, which caused
updateScrollButtonState
to keep attempting to recalculate whether or not to show the left and right buttons.