1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
import { useState } from 'react' function App() { const [count, setCount] = useState(0) return ( <> <button type="button" className="counter" onClick={() => setCount((count) => count + 1)} > Count is {count} </button> </> ) } export default App