set counter in react

      const [count, setCount] = useState(0);


<p>You clicked {count} times</p>

      <button onClick={() => setCount(count + 1)}>
        Click me
      </button>

Post a Comment

0 Comments