Activity: Adding Items to the Shopping Cart

Scenario

We want to allow the user to add items to the shopping cart by picking them from the product catalog.

Aim

The aim of this activity is to become familiar with event management in React.

Steps for Completion

  1. Consider the existing project in the my-cart-01 folder
  2. Handle the click event of the Product component's Add to cart button in order to add that product to the cart

Solution

A possible solution is the one contained in the my-cart-02 folder at Code/Chapter-3/.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.149.222