Created
January 5, 2021 21:28
-
-
Save AllanGraves/d8ec171e0833471573c5c1084659a681 to your computer and use it in GitHub Desktop.
A small React State Hook to simulate the didComponentMount and willComponentUnmount React Life cycle functions
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(() => { | |
console.log('Screen 1 Mount: '); | |
console.log(navigation.dangerouslyGetState()); | |
return () => { | |
console.log('Screen 1 Unmount:'); | |
console.log(navigation.dangerouslyGetState()); | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment