source:
pages/index/Counter.tsx@
66bf4fd
| Last change on this file since 66bf4fd was 8ee4553, checked in by , 7 months ago | |
|---|---|
|
|
| File size: 233 bytes | |
| Line | |
|---|---|
| 1 | import { useState } from "react"; |
| 2 | |
| 3 | export function Counter() { |
| 4 | const [count, setCount] = useState(0); |
| 5 | |
| 6 | return ( |
| 7 | <button type="button" onClick={() => setCount((count) => count + 1)}> |
| 8 | Counter {count} |
| 9 | </button> |
| 10 | ); |
| 11 | } |
Note:
See TracBrowser
for help on using the repository browser.
