Next.js Discord

Discord Forum

Loading page triggering on router.refresh()

Unanswered
Beveren posted this in #help-forum
Open in Discord
BeverenOP
So if you can notice, first i create a ticket and then call router.refresh(), which works as expected, new data appears while no loading pages are triggered.

But when i edit a ticket and call router.refresh() when i go back from a modal to a modal to the page, the loading.tsx for each route is being triggered along the way. why so? and how do i fix that

3 Replies

Siberian Flycatcher
Hi 👋.
Could you create a CodeSandbox with your code?
@Siberian Flycatcher Hi 👋. Could you create a CodeSandbox with your code?
BeverenOP
hello! (big fan of your videos)
I don't think i can do that, its my companies code, but i've been trying to solve this issue for a month now.
Tomorrow I'll try to re create this exact scenario on codesandbox
BeverenOP
I think i know what the issue is,
when i create a new ticket and call router.refresh(), im still in the same page,
but when go into the modals (which are intercepted routes) the pages are changing so the router.refresh() is cause the loading.tsx to be triggered