16 lines
457 B
JavaScript
16 lines
457 B
JavaScript
import { useState } from 'preact/hooks';
|
|
|
|
export default function ButtonDisplayCounter() {
|
|
const [count, setCount] = useState(0);
|
|
|
|
return (
|
|
<button
|
|
type="button"
|
|
onClick={() => setCount((value) => value + 1)}
|
|
className="rounded-e-xl border border-border-hairline border-s-0 px-3 py-2 text-xs font-mono text-text-muted hover:bg-canvas-deep"
|
|
>
|
|
Clicks: {count}
|
|
</button>
|
|
);
|
|
}
|