source:
pages/index/Counter.tsx@
c30935a
| Last change on this file since c30935a was 8ee4553, checked in by , 7 months ago | |
|---|---|
|
|
| File size: 233 bytes | |
| Rev | Line | |
|---|---|---|
| [8ee4553] | 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.
