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 form fields for basic form

Creating form fields for basic form

From the course: Building React and Django Apps

Start my 1-month free trial

Creating form fields for basic form

- Now let's update the form field component. It's a self contained component where data is passed in for display and changes to the field are propagated upwards to the containing checkout component. We're going to display the name, the label, and the value. And propagate changes up through the onUpdate callback. We're going to create the onChange callback which will call onUpdate with the field name and the updated value. We rendered the label and then the input for the form field. The name, the value, and the onChange callback. Let's run the development servers. We can see how this looks by adding an item to the cart and you can see that our checkout form has all the fields there and it shows the item that we will be ordering. But it doesn't have any styling, so let's fix that. We open checkout.css for the checkout forms styling. We're going to set it up using a flex layout, the direction will be column and we set up some…

Contents