mirror of
https://github.com/cloudflare/vinext.git
synced 2026-09-14 19:04:59 +08:00
25 lines
427 B
TypeScript
25 lines
427 B
TypeScript
"use client";
|
|
|
|
import { useState } from "react";
|
|
import styles from "./counters.module.css";
|
|
|
|
function MyButton() {
|
|
const [count, setCount] = useState(0);
|
|
|
|
function handleClick() {
|
|
setCount(count + 1);
|
|
}
|
|
|
|
return (
|
|
<div>
|
|
<button onClick={handleClick} className={styles.counter}>
|
|
Clicked {count} times
|
|
</button>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default function Counters() {
|
|
return <MyButton />;
|
|
}
|