Created
April 25, 2019 05:35
-
-
Save syeo66/2875f6d8df26ee400a695d2c0c92ddc4 to your computer and use it in GitHub Desktop.
A small snippet of a counter using useState()
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); | |
console.log(counter); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment