demotama.blogg.se

Browser goes back to the previous page automatically
Browser goes back to the previous page automatically






We use a Custom App ( pages/_app.js) for this example to subscribe to the event because it's not unmounted on page navigations, but you can subscribe to router events on any component in your application.

browser goes back to the previous page automatically browser goes back to the previous page automatically

If you want to access the router object inside any function component in your app, you can use the useRouter hook, take a look at the following example: import

browser goes back to the previous page automatically

Before moving forward, we recommend you to read Routing Introduction first.








Browser goes back to the previous page automatically