Chapter 13. Forms

Code Café’s users can add tasty treats to the cart and update it to have exactly the items they want. Next, they need to be able to submit their orders.

When the user places an order, you need to collect certain information, such as the customer’s name. To do this, you will add a form to the cart page.

Forms allow users to input and submit information. If you are familiar with HTML forms, you will probably recognize the basic elements used to build forms in React. Because these elements are interactive and used to capture input, there are some caveats to working with them in React. This chapter will explore ways to implement form elements in your application, including managing state.

When the user is ready to place an order, ...

Get React Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.