From the course: Building React and Django Apps

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Creating a basic form as a React component

Creating a basic form as a React component

From the course: Building React and Django Apps

Start my 1-month free trial

Creating a basic form as a React component

- [Narrator] The Checkout form needs to be implemented. It's going to use the AppContext. In the render method. these are the methods and data we're going to need from that context. We're going to be displaying four input fields. One for the users name, another for their email address, their street address and their city. Now let's render each form field by mapping the input fields and using the formField component. The field value comes from the booking model and whenever we update this form field we're going to use the updateField callback from the AppContext. And then we pass in the rest of the field properties. We're going to display the item that is about to be ordered along with a button to remove it. Here's the Remove button and when we click, we use the AppContext clearOrderItem method and we pass in the item.id. And within this button, we're also going to have a nice icon that comes from the Font Awesome…

Contents