Skip to content

Instantly share code, notes, and snippets.

@AllanGraves
Created January 5, 2021 21:28
Show Gist options
  • Save AllanGraves/d8ec171e0833471573c5c1084659a681 to your computer and use it in GitHub Desktop.
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
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