๐Ÿ“ฆ cloudflare / vinext

๐Ÿ“„ counter.tsx ยท 12 lines
1
2
3
4
5
6
7
8
9
10
11
12import { useState } from "react";

export function Counter() {
  const [count, setCount] = useState(0);
  return (
    <div>
      <p>Count: <span id="count">{count}</span></p>
      <button id="increment" onClick={() => setCount(count + 1)}>+</button>
    </div>
  );
}