Created
August 26, 2019 02:27
-
-
Save CMCDragonkai/5edaccd6688fca87013613993ca0236a to your computer and use it in GitHub Desktop.
React Lifecycle Hooks #js #react
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
// all react lifecycle stages can be hooked into using the `useEffect` hooks | |
// acquired from here: https://stackoverflow.com/a/55041347/582917 | |
useEffect( () => console.log("mount"), [] ); | |
useEffect( () => console.log("will update data1"), [ data1 ] ); | |
useEffect( () => console.log("will update any") ); | |
useEffect( () => () => console.log("will update data1 or unmount"), [ data1 ] ); | |
useEffect( () => () => console.log("unmount"), [] ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment