#1 Data Analytics Program in India
₹2,499₹1,499Enroll Now
5 min read
Question 9 of 48medium

Forms 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)