Routing
Unanswered
Great Blue Heron posted this in #help-forum
Great Blue HeronOP
okay so i have a dashboard route, and inside it /dashboard/invoice, /dashboard/plan etc.. issue is i dont know how to add a loading screen when navigating between them to make it look smoother, there is no backend fetching except in like two routes, anyone can tell me what to do?
8 Replies
Asian black bear
By relying on the automatically added Suspense boundary via https://nextjs.org/docs/app/api-reference/file-conventions/loading or by manually wrapping your data fetching code with a suitable Suspense boundary.
@Asian black bear By relying on the automatically added Suspense boundary via https://nextjs.org/docs/app/api-reference/file-conventions/loading or by manually wrapping your data fetching code with a suitable Suspense boundary.
Great Blue HeronOP
i added the loading.tsx file with a loading spinner component, i have no data fetching code, is suspense the thing that i should try out?
Asian black bear
Navigating between pages will trigger the automatically added Suspense boundary and display the content of the loading.tsx file until the entire content is provided by the server.
Great Blue HeronOP
what if the content is very minimal?
it loads so quickly that u see a flash of the loading screen or nothing at all sometimes
Asian black bear
Why do you need it if the transition is near instantaneous?
@Asian black bear Why do you need it if the transition is near instantaneous?
Great Blue HeronOP
looks chopped when going from one page to another
sorry i am a new developer