Skip to content

Commit bc03a92

Browse files
committed
Refetch after adding to cart
1 parent a530ba5 commit bc03a92

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

components/Cart/AddToCartButton.component.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ const AddToCartButton = ({ product }) => {
7474
const handleAddToCartClick = () => {
7575
setRequestError(null);
7676
addToCart();
77+
// Update the cart with new values in React context.
78+
refetch();
7779
};
7880

7981
// Separate out conditions here for increased readability

0 commit comments

Comments
 (0)