5 min read
•Question 9 of 48mediumForms and Controlled Components
Managing form state in React.
Controlled Components
In controlled components, form data is handled by React state. The input value is controlled by state and updated via onChange.
Controlled vs Uncontrolled
- Controlled: React state is the "single source of truth"
- Uncontrolled: DOM handles form data (using refs)