adrianhajdin / ecommerce_sanity_stripe

Modern Full Stack ECommerce Application with Stripe
https://jsmastery.pro
2.21k stars 675 forks source link

setCartItems only updates on second click of add to cart button, with the previous product and quantity #86

Open uc129 opened 1 year ago

uc129 commented 1 year ago

Hi Adrian, I am having an issue with the onAdd function, where the setCartItems only updates on the second click of the add to cart button. I have asked the question on StackOverflow and the link is below. If you have any insights please, can you help? And also, thank you for all the amazing work that you are doing.

console logs of updating the state

Screen Shot 2022-12-12 at 2 39 20 pm

Thank You. Question with details on stack overflow-