Created
April 8, 2019 10:23
-
-
Save andregardi/b76bb02242756fc96a707b461dc14b36 to your computer and use it in GitHub Desktop.
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
// Without the second parameter | |
useEffect(() => { | |
console.log('I will run after every render'); | |
}); | |
// With the second parameter | |
useEffect(() => { | |
console.log('I will run only when valueA changes'); | |
}, [valueA]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment