How to Fetch Form Data in React? #knowledgekeen #react

preview_player
Показать описание
Forms are created for every application and if there is a form then we need to fetch the data that we've received from the form. In today's video let us see how to fetch the data from the form elements. two ways of fetching data in react controlled and uncontrolled way.

A few comparison points for the form elements that I've mentioned in the video too .. :-)
Controlled
1. In a layman's language - It is controlled by React.
2. Internal state is not maintained.
3. Data is controlled by parent component.
4. Accepts its current value as a prop.
5. Validation is easier.
6. Better control over form elements and their data.

Uncontrolled
1. It is controlled by old school DOM and JavaScript.
2. Maintains its internal state.
3. Data is controlled by the DOM itself.
4. Uses a ref for their current value.
5. Validation can be manual and difficult.
6. Limited control over form elements and their data.

#knowledgekeen
#knowledge keen
#react
#reactjs
#reacttutorial
Рекомендации по теме
Комментарии
Автор

sir do talk about functional update and lazy initialization and their usecases in usestate video.

ankitkumain
Автор

sir, is it possible to fetch previous state with ref other than current state.. please let me know

lucifer
join shbcf.ru