1 file changed
counter.tsx
+2
-2
1
import { useState } from "react";
2
3
export function Counter() {
3
export function Counter({ start = 0 }) {
4
const [count, setCount] = useState(0);
4
const [count, setCount] = useState(start);
5
return (
6
<button onClick={() => setCount((n) => n + 1)}>
7
Clicked {count} times
⋯