Concept
useState gives a component a value that survives re-renders and a setter that schedules a re-render when it changes. Each call to the setter replaces the value; React batches several into one render.
The tutor works through these with you, in conversation and code. A session ends when you have shown them, not when a video does.
A few lines that show useState doing its job.
function Counter() {
const [count, setCount] = useState(0);
const addThree = () => {
setCount((c) => c + 1);
setCount((c) => c + 1);
setCount((c) => c + 1); // 3, because each uses the latest value
};
return <button onClick={addThree}>{count}</button>;
}Mutating state in place, like items.push(x) followed by setItems(items). The array is the same object, so React sees no change and skips the render. Create a new array: setItems([...items, x]).
Your roadmap puts these before useState, unless you already know them.
Once a session shows you understand useState, it comes back for review. Each review takes a minute and tells the memory model how well you still know it.
Topics that build on useState.