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

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…

Contents