Skip to content

Instantly share code, notes, and snippets.

@just1and0
Created May 11, 2019 11:14
Show Gist options
  • Save just1and0/132fdb5d439dd478e2d231a5f35b74b9 to your computer and use it in GitHub Desktop.
Save just1and0/132fdb5d439dd478e2d231a5f35b74b9 to your computer and use it in GitHub Desktop.
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