Next.js Discord

Discord Forum

Help me with config the return page

Unanswered
Reyes posted this in #help-forum
Open in Discord
- I have router.back() in one component. But that component can navigate from many different pages, in case I copy the page to another tab and use router.back (), when you back the page first, which page it will return to.

- I hope you can help me to handle this problem, thank you very much

1 Reply

each time you visit a page, it’s added to the navigation stack. When you call router.back(), it always returns to the last page in that stack.