Next.js Discord

Discord Forum

Display loading.tsx as soon as router.push is called

Unanswered
West African Lion posted this in #help-forum
Open in Discord
Avatar
West African LionOP
Is there a way to force the loading.tsx component to display as soon as router.push has been called?
I have noticed there is a delay, such as when a user submits a form resulting in router.push, before the loading component appears.

5 Replies

Avatar
European sprat
Have you tested production build? Dev mode can be slow for things to show up but it may work fine in production
Avatar
West African LionOP
Seems to be the same situation in production builds too. I'm wondering if loading will only display once it has actually started loading the new page after the url has been pushed and the delay between pushing and starting to load might be longer than expected.
Avatar
Blanc de Hotot
Avatar
European sprat
This doesn't work with app directory and isn't really relevant to loading.tsx
Avatar
Alfonsus Ardani
does this happen on prod?