Next.js Discord

Discord Forum

router.push doesn't provide an indicator

Unanswered
Cape lion posted this in #help-forum
Open in Discord
Avatar
Cape lionOP
hello, in my nextjs project im using the app router and i've noticed that when navigating on click with router.push it doesn't provide any indicator that the page is loading. i have a loading.tsx file in my app directory but that doesnt appear when navigating with router.push. is there a way to add an indicator because it looks very weird when navigating from page to another

9 Replies

Avatar
Cape lionOP
bump
Avatar
Clown
Image
Also when working navigation, its supposed to be immediate, meaning it should switch to the next page almost immediately. In dev this doesn't happen since it needs to first compile the new page and then show it.

To actually check the how it would work when deployed:
npm run build
npm start
Avatar
Cape lionOP
that's the weird part
the problem persists even in the deployed version of my app on vercel
Avatar
Cape lionOP
bump
Avatar
Cape lionOP
bump
Avatar
Gull Terrier
I sort of had similar issues but it's actually the expected behavior. You can try the revalidateTag/revalidatePath or some kind of spinner on the actual page. for example, if youre changing a date with a stateful component, you can set a loading state on submission and display some spinner next to that component.