clearTimeout() on componentWillUnmount
See original GitHub issueI’m getting this error when i navigate to another page:
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 for the ToastContainer component.
Shouldn’t the component clearTimeout() when it unmounts?
Issue Analytics
- State:
- Created 6 years ago
- Comments:15 (8 by maintainers)
Top Results From Across the Web
Better way to clearTimeout in componentWillUnmount
5. You need to save the value returned from setTimeout() somewhere and pass that in to clearTimeout() . · 3 · The value...
Read more >Javascript – Better way to clearTimeout in componentWillUnmount ...
I have a working Loading Component that cancels out when it has been loading for 8 seconds. This code works but it feels...
Read more >Better way to clearTimeout in componentWillUnmount-Reactjs
[Solved]-Better way to clearTimeout in componentWillUnmount-Reactjs ... componentDidMount = () => { // *** // Remember the timer handle // *** this.
Read more >Using setTimeout in React components (including hooks)
To clear a timeout, we need to call clearTimeout with the ... Then we clear the timeout in the lifecycle function componentWillUnmount :....
Read more >How to use clearTimeout function in react-native - Tabnine
src/components/CustomLoader.js/Pulse/componentWillUnmount. componentWillUnmount() { this.mounted = false; clearTimeout(this.
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
Sorry for the late answer, i moved the ToastContainer to the router component parent to fix it, like you said in the last comment.
You are welcome @realneeraj. @ricardojrgpimentel you were encountering that error probably for the same reason. I’ll close the issue. Feel free to create a new one is the issue is not related.