Your code appears to be correct and should function as expected. However, if you're manually navigating to the /cart
page in the browser, that could cause an issue. When you reload or visit the cart
page directly, the application's state may be lost, which could affect the functionality. To avoid this, try to navigate within the application itself, rather than refreshing or directly entering the /cart
URL.