Created
July 9, 2022 19:09
-
-
Save achingachris/e3e85f714b5f0921450f0ce480322140 to your computer and use it in GitHub Desktop.
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
import { useState } from 'react' | |
const App = () => { | |
const [count, setCount] = useState(0) | |
const handleClick = () => { | |
setCount((count) => { | |
return count + 1 | |
}) | |
} | |
return ( | |
<div className='container'> | |
<h1>Counter</h1> | |
<p>{count}</p> | |
<button className='btn btn-outline-secondary' onClick={handleClick}>Click Me!</button> | |
</div> | |
) | |
} | |
export default App |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment