Controlled Inputs
A controlled input gets value from state and updates it on change.
Example
function Name() {
const [v, setV] = useState("");
return (
<input value={v} onChange={(e) => setV(e.target.value)} />
);
}Exercise
Read the typed text.
e.target.Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.