React 16 : componentDidUpdate Warning: Scheduled a cascading update
See original GitHub issueI profiled the performance of my application using react redux by following this article by Ben Schwarz.
In the user timing section, i get these warnings (with a no entry sign): There is two messages:
(Committing Changes) Warning: Lifecycle hook scheduled a cascading update
Connect(MyComponent).componentDidUpdate Warning: Scheduled a cascading update
I made some search but i found nothing special. It seems related to the componentDidUpdate function of the connect
HOC of react-redux.
What does these messages means ?
Issue Analytics
- State:
- Created 6 years ago
- Comments:38 (11 by maintainers)
Top Results From Across the Web
componentDidUpdate Warning: Scheduled a cascading update
According to link - Gaearon, the warning means what it says: you scheduled a cascading update. "Cascading" means an update inside an update....
Read more >[Solved]-React 16 : componentDidUpdate Warning
The messages mean that componentDidUpdate is getting changed props or setting the state and so the update will cascade (happen right after the...
Read more >React.Component
UNSAFE_componentWillUpdate() is invoked just before rendering when new props or state are being received. Use this as an opportunity to perform preparation ...
Read more >Filters - Sourcegraph
node_modules/react/index.js\");\nvar warning = __webpack_require__(/*! ... This can happen in a test environment if a component schedules an update from an ...
Read more >مدیاویکی:Gadget-experimental-react.js - ویکیپدیا، دانشنامهٔ آزاد
Similar to invariant but only logs a warning if the condition is not met. ... warning = 'Lifecycle hook scheduled a cascading update'; ......
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
It means what it says: you scheduled a cascading update. “Cascading” means an update inside an update. React first reconciles the tree by calling
render
, then commits DOM changes, then calls lifecycle hooks. If you callsetState
incomponentDidMount
, you are causing React to repeat the cycle: reconcile the tree, commit DOM changes, and call the hooks. This is wasteful.Eh. Really unfortunate that this approach causes people to learn to ignore an otherwise valid and useful warning. Hopefully we can figure out a solution with the new context API soon. 😃