Skip to content

Instantly share code, notes, and snippets.

@andregardi
Created April 8, 2019 10:23
Show Gist options
  • Save andregardi/b76bb02242756fc96a707b461dc14b36 to your computer and use it in GitHub Desktop.
Save andregardi/b76bb02242756fc96a707b461dc14b36 to your computer and use it in GitHub Desktop.
// 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