Complete Controlled Input
Fill in the Blank Easy
Question
Fill in the blank to bind the input value to state.
Code
const [text, setText] = useState("");
return <input _____={text} onChange={e => setText(e.target.value)} />;
Hint
Which prop controls the input's displayed value?
Explanation
The value prop binds the input's displayed value to the state variable. Combined with onChange updating state, this makes the input controlled — React state is the single source of truth.
Related Resources
Related Lessons
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.