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.

After certain time leads to Redux warning "setState() on an unmounted component"

See original GitHub issue

I am testing v5 alpha from #416 and noticed that after some time every re-render in one of my components starts triggering following warning:

Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op. Please check the code

My best guess is that there is a memory leak somewhere and new connect holds a reference to unmounted component. Triple checked that it doesn’t happen with 4.4.5.

It doesn’t happen right away, only after I switch back and forth between routes that re-render a lot of components. I don’t have time to dig deeper and set up a test project, but I can create a branch in my public repo where it’s happening to reproduce. Please let me know if you want this.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:22 (15 by maintainers)

github_iconTop GitHub Comments

3reactions
timdorrcommented, Aug 27, 2016

react-redux-5.0.0-beta.1 has been published to react-router@next!

2reactions
Restutacommented, Aug 20, 2016

Don’t hesitate to send a PR with minimal repro setup for the branch I created @vhmh

Read more comments on GitHub >

github_iconTop Results From Across the Web

React warning about setState in unmounted component
Warning : Can't call setState (or forceUpdate) on an unmounted component. This is a no-op, but it indicates a memory leak in your...
Read more >
Avoid React state update warnings on unmounted components
React raising a warning when you try to perform a state update on an unmounted component. React setState is used to update the...
Read more >
Prevent React setState on unmounted Component
The shown warning(s) usually show up when this.setState() is called in a component even though the component got already unmounted.
Read more >
How to work with React the right way to avoid some common ...
Warning : Can't call setState (or forceUpdate) on an unmounted component. This is a no-op, but it indicates a memory leak in your...
Read more >
React state update on an unmounted component - debuggr.io
Warning : Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in...
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