Next.js Discord

Discord Forum

router.push() uses wrong loading.tsx file

Unanswered
Large oak-apple gall posted this in #help-forum
Open in Discord
Large oak-apple gallOP
Hi,
When I use log in form, if credentials are valid, I use router.push to redirect user to /shell/ route, which redirects to /shell/dashboard/.
I created skeletons for both login form (blue loading.tsx in file tree), and shell (green loading.tsx) which is mocked sidebar and content wrapper.
The expected behaviour is to load blue one when I enter / route, but when I pass credentials, during redirect I want to display green loading.tsx with mocked shell. Instead, next.js displays blue even when loading /shell/ route.

0 Replies