Created
April 13, 2019 08:15
-
-
Save ohansemmanuel/2c14da3b372a0dde39e9a0b0b11d38fb to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| const MultipleEffects = () => { | |
| // ๐ | |
| useEffect(() => { | |
| const clicked = () => console.log('window clicked') | |
| window.addEventListener('click', clicked) | |
| return () => { | |
| window.removeEventListener('click', clicked) | |
| } | |
| }, []) | |
| // ๐ another useEffect hook | |
| useEffect(() => { | |
| console.log("another useEffect call"); | |
| }) | |
| return <div> | |
| Check your console logs | |
| </div> | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment