Closed brixNessia closed 2 years ago
Hello
please provide some kind of codesandbox showing the error so I can help further.
Thanks 🙏
This is the value if the useCart() that holds the addItem function when I don't refresh the page.
This is the value if the useCart() that holds the addItem function when I refresh the page.
This is the error when I try to addItems in the cart
@notrab
This is the function that handles the addItem to cart
please provide some kind of codesandbox showing the error so I can help further.
Here the code sandbox link
https://codesandbox.io/s/modest-sid-gkvyp1?file=/src/App.js
I have been provided the same code in npm package Demo code and it shows the same error. Please help us!!
@Sudharsan-learning Hey
You have no CartProvider 😄
@notrab Thank you for your response.
I already found it.
AddItem is working at first, but when I refresh the page this AddItem is not a function error is displayed. I've tried console.log() the value of useCart and all the function is gone when I refresh it.