Tsallaka zuwa abun ciki
Justice Tech School

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

What makes an input controlled?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.