Concept
A controlled input takes its value from React state and reports changes through onChange, so the state is always the truth. It makes validation, formatting and resetting straightforward.
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 Controlled inputs doing its job.
function NameField() {
const [name, setName] = useState("");
return (
<label>
Name
<input
value={name}
onChange={(e) => setName(e.target.value)}
maxLength={40}
/>
</label>
);
}Setting value without onChange, which makes the input read-only and triggers a console warning. Or starting the state as undefined, which switches the input from uncontrolled to controlled mid-life.
Your roadmap puts these before Controlled inputs, unless you already know them.
Once a session shows you understand Controlled inputs, 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 Controlled inputs.