Start here. This is the direct spoken answer to practice first.
Why this question matters
This is a practical bug source in interviews and real apps. Candidates often know how to call setState, but not how queued updates and stale values behave.
React state setters schedule an update for a future render. The current render's state variable does not change immediately inside the same function. React may also batch multiple updates before rendering. When the next value depends on the previous value, I would use the functional setter form, such as setCount(previous => previous + 1), because it receives the latest queued state for that update.