Question 10 of 10Pro 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