Created
May 11, 2019 11:14
-
-
Save just1and0/132fdb5d439dd478e2d231a5f35b74b9 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
function CounterFunction() { | |
const [count, setCount] = React.useState(1); | |
return ( | |
<div> | |
<p>Count: {count}</p> | |
<button onClick={() => | |
setCount(count + 1)} | |
>Increase</button> | |
</div> | |
); | |
} | |
ReactDOM.render( | |
<div> | |
<CounterFunction /> | |
</div> | |
, document.querySelector('#app')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment