Can't perform a React state update on an unmounted component with React 17
See original GitHub issueI’m seeing this warning on switching routes in my app, such that the RTF component is unmounted. This has only started occurring with React 17 - I didn’t observe it with React 16.x.
Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.
at ResizeContainer (https://localhost:3000/static/js/10.chunk.js:40975:5)
at Canvas (https://localhost:3000/static/js/10.chunk.js:41016:5)
...
There have been no other changes made to the RTF component or routing logic in the app.
Using:
"drei": "1.5.7",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-three-fiber": "5.1.4",
"three": "^0.122.0",
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Can't perform a React state update on an unmounted ...
Problem. I am writing an application in React and was unable to avoid a super common pitfall, which is calling setState(...) after ...
Read more >Can't perform a React state update on an unmounted ... - Reddit
Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application....
Read more >React: Prevent state updates on unmounted components
Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your...
Read more >React prevent state updates on unmounted components
Warning: Can't perform a React state update 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 your...
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 Free
Top 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
it came from react-use-measure, it should be fixed.
a minimal codesandbox would be easier, something without so much setup and redirection. from what i understand this is a common problem in react 17 and can can easily creep into regular userland code, just have any async setstate and it happens. don’t wanna climb through a full routing setup just to find the starter causes it.