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.
Learner's Ratings
4.4
Overall Rating
73%
11%
9%
1%
6%
Reviews
M
Mohanlal Khhurana
5
Very helpful course in learning ReactJS
A
Aditya
5
Amazing content.
S
Sonkar Singh
4
This series is usefull for just starting and building confident. Go further and explore more about React JS
S
Sumit Kumar
5
Fake reviews
M
Mahaveer kumar kirshanani
5
amazing mam , keep going
R
Rakeh
5
nice
A
Anshul Bhai
5
This is very helpful
Y
yash sheliya
5
My explaining in learnvern was good. Thank you for Learn Vern to all teachers
Share a personalized message with your friends.