You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a weird bug, I cant get the Cart to clear on the success page after returning from stripe.
If I click on another page, then return to the success page the cart clears. Its just when I come to that page from stripe, or copy / paste the url into a browser. The clearCart function is wrapped in a useEffect like below, and is in a 'use client' component.
useEffect(() => { clearCart(); }, []);
I have found if I wrap the clearCart in a setTimeout it works, but this feels like bit of a hack. Has anyone else had this issue?
The text was updated successfully, but these errors were encountered:
@graemec23 experiencing this issue too with NextJS 14. Glad am not the only one who tried the setTimeout hack 😅 . Did you manage to figure out what is happening?
I have a weird bug, I cant get the Cart to clear on the success page after returning from stripe.
If I click on another page, then return to the success page the cart clears. Its just when I come to that page from stripe, or copy / paste the url into a browser. The clearCart function is wrapped in a useEffect like below, and is in a 'use client' component.
useEffect(() => { clearCart(); }, []);
I have found if I wrap the clearCart in a setTimeout it works, but this feels like bit of a hack. Has anyone else had this issue?
The text was updated successfully, but these errors were encountered: