Created
April 25, 2019 05:43
-
-
Save syeo66/8e3d6999f3fc11cb2fbcd023769406f3 to your computer and use it in GitHub Desktop.
Add 2 to the counter... the wrong way
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
const [counter, setCounter] = useState(0); | |
const handleClick = () => { | |
setCounter(counter + 1); | |
setCounter(counter + 1); | |
} | |
console.log(counter); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment