18 lines
401 B
TypeScript
18 lines
401 B
TypeScript
import React, { useState } from "react";
|
|
|
|
export function Counter() {
|
|
const [count, setCount] = useState(0);
|
|
|
|
return (
|
|
<button
|
|
type="button"
|
|
className={
|
|
"inline-block border border-black rounded bg-gray-200 px-2 py-1 text-xs font-medium uppercase leading-normal"
|
|
}
|
|
onClick={() => setCount((count) => count + 1)}
|
|
>
|
|
Counter {count}
|
|
</button>
|
|
);
|
|
}
|