Question 4 of 6Pro Only

What is the difference between controlled and uncontrolled components in React?

Sample answer preview

Controlled and uncontrolled components are two approaches to handling form inputs in React. In a controlled component, React state is the single source of truth. The input value is driven by state, and every change updates that state: const [name, setName] = useState(''); <input…

controlleduncontrolledformsrefstateonChange

Unlock the full answer

Get the complete model answer, key points, common pitfalls, and access to 5+ more Frontend Developer interview questions.

Upgrade to Pro

Starting at $19/month • Cancel anytime