Chapter 12. Editing the Cart
Developing Code Café has given you experience with building functional components. You have also added state to keep track of the user’s cart
and are using the useReducer
hook to manage that state.
In this chapter, you will create a route for users to view and edit the cart. This chapter uses concepts you already know, giving you the opportunity to practice your skills as you expand your app.
Try to write each new piece of code without first looking at the snippets we provide. When you finish, compare your code with ours. You might do some things differently from how we do them – that is fine, as long as your app behaves as expected. But we do recommend that you edit your code to match ours before moving forward ...
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.