Course Content

  • 4. Events

Course Content


A controlled component receives the altered value from the callback function, whereas an uncontrolled component receives it from the DOM. For example, we can use the onChange function in Controlled Component to get the value when the input value is updated, and we can also access the value using DOM like ref.

Form data is handled by a React component in a controlled component. Form data is handled by the DOM itself in uncontrolled components. Controlled components must make use of Component State.

The default behaviour of HTML form elements is overridden by a managed component. By setting the attribute value of the form element (input>, textarea>, or select>) and the event onChange, we can create a controlled component.

An uncontrolled component renders form elements with the data of the form element being handled by the DOM (default DOM behavior). You can use a ref to get to the input's DOM node and get its value.

Recommended Courses

Share With Friend

Have a friend to whom you would want to share this course?

Download LearnVern App

App Preview Image
App QR Code Image
Code Scan or Download the app
Google Play Store
Apple App Store
598K+ Downloads
App Download Section Circle 1
4.57 Avg. Ratings
App Download Section Circle 2
15K+ Reviews
App Download Section Circle 3
  • Learn anywhere on the go
  • Get regular updates about your enrolled or new courses
  • Share content with your friends
  • Evaluate your progress through practice tests
  • No internet connection needed
  • Enroll for the webinar and join at the time of the webinar from anywhere