I want to redirect users to "success/[id]" after a successful PayPal payment using dynamic links. The id, which corresponds to the orderId from PayPal, should replace the placeholder. For instance, it should look like "success/orderid?=skdaaisjda". I also need to store this data locally. However, when attempting this, I encounter an error:
Error: NextRouter was not mounted. For more information, refer to https://nextjs.org/docs/messages/next-router-not-mounted.
This issue arises in my code at line 84 in the file components\Cart.tsx.
https://github.com/yoboywhat/Paypal-onApprove-Redirect-Issue-21-02-2024-/tree/main