From the course: Build Modern Web Apps with React, Hooks, State Management, and APIs Using Vite or Next.js

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Forms introduction

Forms introduction

Hello and welcome to module number 5 of this course. In this module, we learn about forms and their validation using React. Let's start off with how we can handle forms and their inputs in React applications. React uses control components to manage the form inputs. We are going to learn about what is control components in more detail in the upcoming slides. The forms elements that we used in react, they are bounded to a react state. We can bound any form element with react state using the useState hook in the function components. After bounding the form element to a React state, React controls what's shown and captured in the input field. User can type on any value and select a form element value and then it's React's responsibility how React actually shows it on onto the DOM. We can enable validations, formatting and the interaction logic of the user. Rest of the things are being catered by React's algorithm. Now I use the term controlled components in the previous slides. Let's…

Contents