Fundamentals3 / 5
Up next

useState

import { useState } from "react";

function Counter() {
  const [count, setCount] = useState(0);
  return <button onClick={() => setCount(count + 1)}>{count}</button>;
}
What you're solving

local state and an event handler