Created
October 31, 2019 00:57
-
-
Save adamrosloniec/202334c3d2ab253d4898a33bf6e883c6 to your computer and use it in GitHub Desktop.
React Hooks - useEffect as componentDidMount & componentWillUnmount
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
useEffect(() => { | |
// componentDidMount | |
InitAnyFunctionAfterDidMount(); | |
// componentWillUnmount | |
return () => { | |
InitAnyFunctionAfterUnmount(); | |
}; | |
}, []); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment