The hook that gives a function component its own persistent, re-render-triggering value.
useState returns a [value, setter] pair, with the value persisting across re-renders via storage attached to that component's fiber rather than living in the function body (which gets recreated every render). Calling the setter schedules a re-render — it doesn't update the variable synchronously within the same render, which is why reading the state variable immediately after calling its setter still shows the old value.
The functional updater form — setCount(prev => prev + 1) instead of setCount(count + 1) — matters specifically when the next state depends on the previous one and multiple updates might be batched together; using the direct value can read a stale closure of the current state, while the functional form always receives the most up-to-date value React has. React 18 also extended automatic batching to group state updates from promises, timeouts, and native event handlers into a single re-render, not just React's own synthetic event handlers as before.
What you'll walk away knowing