summaryrefslogtreecommitdiff
path: root/src/components/Counter.jsx
blob: a2ae7c38015659009c42b082e9daef73d7b3b797 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
import { useState } from 'react';

export default function Counter() {
  const [count, setCount] = useState(0);

  return (
    <div className="counter">
      <button onClick={() => setCount(count + 1)}>
        Clicked {count} times
      </button>
    </div>
  );
}