#React Context for adding items to cart

7 messages · Page 1 of 1 (latest)

hard flint
#

I can take a look at your repo a bit later today.

hard flint
#

I took a look at your code

#

I'd like to say that you did a very good job with your provider and with your util functions, so well done. 👍

#

There a few simplifications we could do but that's another topic.
So if I understand you correctly, you want to see the "added/selected" products when we click on the cart?

runic berry
#

Yeah. I just want to make sure the data is actually getting transferred so I can render them in my Cart component

hard flint
#

it is getting saved into your context, you can log out the carts in your provider and they are there.

#

Now you just need to access the context inside your Cart component and render out the items