We're having a growing number of packages in this repository. This PR moves them into a `packages/` directory like it's commonly done in other projects.
14 lines
275 B
TypeScript
14 lines
275 B
TypeScript
import { useState } from "preact/hooks";
|
|
|
|
export function CounterHooks() {
|
|
const [count, set] = useState(0);
|
|
|
|
return (
|
|
<div class="counter-hooks">
|
|
<button type="button" onClick={() => set((v) => v + 1)}>
|
|
count: {count}
|
|
</button>
|
|
</div>
|
|
);
|
|
}
|