Skip to content

Instantly share code, notes, and snippets.

@achingachris
Created July 9, 2022 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save achingachris/e3e85f714b5f0921450f0ce480322140 to your computer and use it in GitHub Desktop.
Save achingachris/e3e85f714b5f0921450f0ce480322140 to your computer and use it in GitHub Desktop.
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