From the course: Building Production-Ready React Apps: Setup to Deployment with Firebase
Unlock the full course today
Join today to access over 24,500 courses taught by industry experts.
Work with forms
From the course: Building Production-Ready React Apps: Setup to Deployment with Firebase
Work with forms
- [Instructor] So now we want to be able to work with the form so we can actually use the user's input to update what we have in the gallery. So let's go back to the code and we're going to add, we're going to start by adding a new local variable right here at the top. That's going to be input, set, input, use state, and I'm going to add a few handler function, handle and change. And as you may guess, we're going to work with the internal states of the form in order to get the information that we type. And then update, change the states. Here we go. And so what we're going to do as well is that we're going to pass this function as prop as well. That's going to be unchange for handle and change and then on submit for handle and submit. And so back in upload form we're going to be able to read from this props and then run the action from the form on submit like so. So we have two inputs in this form. So one first…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Introduction to Hooks API Reference2m 52s
-
(Locked)
Learn event handling and updating the state4m 12s
-
(Locked)
Handle conditional rendering3m 47s
-
(Locked)
Work with forms4m 1s
-
(Locked)
Submit the form and apply side effects: useEffect5m 32s
-
(Locked)
Validate and submit forms: useMemo6m 11s
-
(Locked)
Handle complex logic with useReducer5m 34s
-
(Locked)
Create and dispatch actions4m 37s
-
(Locked)
Compose and update the UI6m 1s
-
-
-
-
-
-
-
-
-
-