After removing items from cart page when I go back to the previous page using router.back() the cart list length does not update. It never works in production but I saw sometimes it worked in local specially when the route gets a reload. but in production it never reloads what could be the reason?
I tried to save the previous route path in session storage and when clicking on the back button instead of using router.back() I have used router.push and the path I pushed got from session storage in this way cart list length gets updated but it is not a good solution as the router history gets changed and falls onto a loop