Creating a shopping cart.
- Create a single state to store all new items in the
<Index />
page and call it Cart. <Form />
component should add more shopping items to the shopping cart that exists inside the App component.- Create a component called
<ShoppingItem />
that's going to contain the shopping items. It can be just a normal<p>
tag, but feel free to design it as you please :D - Pass the shopping carts state as a prop to
<Shopping Cart/>
which should map out all the results from the shoping cart using the<ShoppingItem />
.
BONUS: Can you add a way in the <ShoppingItem />
to delete the selected item from the list?