Forms in React can be implemented with controlled and uncontrolled components. The difference between the two methods is where the state is managed. With controlled components, the state is managed by react's state management features. When using uncontrolled components, the input fields manage their own state. Controlled components are implemented by setting the value attribute and onChange event to read and modify a state variable. Uncontrolled components' value can be read either by using refs to access the input elements or by creating a new form data object on form submit.
Contents:
0:00 Introduction
0:48 Controlled Components
2:53 Uncontrolled Components
3:22 FormData Approach
3:52 Conclusion
Email: [email protected]
Twitter: / nikelaz
LinkedIn: / nikola-lazarov
#react #course
Смотрите видео Forms with Controlled and Uncontrolled Components - Introduction to React #7 онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь NL Tech 29 Октябрь 2022, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 663 раз и оно понравилось 22 людям.