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.

React 16 : componentDidUpdate Warning: Scheduled a cascading update

See original GitHub issue

I 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:closed
  • Created 6 years ago
  • Comments:38 (11 by maintainers)

github_iconTop GitHub Comments

53reactions
gaearoncommented, Dec 15, 2017

can either of you give some additional info on what the warning actually means, both in terms of the cause and resulting behavior?

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 call setState in componentDidMount, you are causing React to repeat the cycle: reconcile the tree, commit DOM changes, and call the hooks. This is wasteful.

34reactions
gaearoncommented, Dec 7, 2017

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. 😃

Read more comments on GitHub >

github_iconTop 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 >

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