What is the difference between controlled and uncontrolled components?
Model answer
A controlled component has its value in React state: the input shows state and an onChange handler updates it, so React is the single source of truth. An uncontrolled component keeps its value in the DOM, and you read it when needed with a ref or FormData.
Controlled inputs are good for live validation and dependent fields. Uncontrolled inputs are simpler for basic forms and file inputs.
Learn this topic
React Components and Props Explained with Examples in the course React.js Full Course: Beginner to Advanced.
Sign in to add your own answer.