Created
December 1, 2020 13:38
-
-
Save heron2014/c8fd0924201d3dfa276e8f330f812cd8 to your computer and use it in GitHub Desktop.
useEffect componentWillUnmount - clean up
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Class | |
componentWillUnmount() { | |
console.log('I am unmouting'); | |
} | |
// Hooks | |
useEffect(() => { | |
return () => console.log('I am unmounting, run me to do any clean up'); | |
}, []) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment