Loading…
A short voice session: one question, one follow-up, then instant feedback — up to 5 minutes.
A controlled input gets its value from React state and reports changes through onChange; an uncontrolled input keeps its own value in the DOM, which you read with a ref or form data.
In a controlled input you pass value and onChange, so React state is the single source of truth and you can validate or transform input on every keystroke. In an uncontrolled input you may set an initial defaultValue, but the DOM owns the current value, and you read it when needed through a ref or from the form's FormData on submit. Controlled inputs make instant validation and dependent fields easy; uncontrolled inputs are simpler and avoid a re-render on every keystroke. Switching an input from uncontrolled to controlled during its lifetime triggers a warning.