Redirecting from modal in intercepted route
I had an issue similar to what is mentioned here: https://github.com/vercel/next.js/issues/49662
I have Links in a modal which is an intercepted route and parallel route. When I click a link the URL in the browser is correct, but needs a refresh to display the correct content. Any ideas how to fix this? I am using the App Router
GitHub
[NEXT-1160] Clicking Links in intercepted routes does not unmount t...
Verify canary release I verified that the issue exists in the latest Next.js canary release Provide environment information Operating System: Platform: linux Arch: x64 Version: #41~22.04.1-Ubuntu S...
6 Replies
maybe try using router=useRouter()
router.push("/");
Thats the one thing that works actually, going to the root. It doesnt work with '/category/games' for example. Might it be something about the slot im in, using the @folder/(.)folder/page structure?
yeah it's not working i don't why
but most probably whenever you are clicking outside the modal you want to go back for that use case you can use router.back();
and it is open issue so most probably we have to wait until when it get resolved
i am using "next": "13.4.5" version router.back() is working
Yeah, I have circumvented the unmount problem with router.back() and the catch-all routes etc. Now the problem is that after the modal closes, the URL is correct, but the content of the page is not. After I refresh the page, the correct content is showed. I will try upgrading my next version. Thank you for your responses!
happy to help
hello, did you find another solution for this?