| 1 | "use client"; |
| 2 | |
| 3 | import { useState } from "react"; |
| 4 | |
| 5 | export default function Counter() { |
| 6 | const [count, setCount] = useState(0); |
| 7 | return ( |
| 8 | <div> |
| 9 | <p data-testid="count">count:{count}</p> |
| 10 | <button |
| 11 | type="button" |
| 12 | data-testid="increment" |
| 13 | onClick={() => setCount((c) => c + 1)} |
| 14 | > |
| 15 | Increment |
| 16 | </button> |
| 17 | </div> |
| 18 | ); |
| 19 | } |