Created
January 7, 2021 05:36
-
-
Save robzlabz/d337f1b796c857bcb950b8f9f85c88c1 to your computer and use it in GitHub Desktop.
Handling State di Functional Component
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 CounterComponent = () => { | |
const [count, setCount] = React.useState(0); | |
return ( | |
<div> | |
<p>Sudah di click: {count} kali</p> | |
<button onClick={() => setCount(count + 1)}>Click Saya</button> | |
</div> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment