Next.js Discord

Discord Forum

Loading.tsx but for initial load

Unanswered
Pacific thread herring posted this in #help-forum
Open in Discord
Pacific thread herringOP
Hello guys, I am new to nextjs and I am loving it!

Having said that, I read about using Loading.tsx files to show a skeleton while a route is loading, but how about a skeleton for the whole page on initial load? What is the best practice for achieving this with nexjs v14?

By having my Loading.tsx file in the root directory, it only shows a skeleton for the main content, i.e. it inherits the layout.tsx and does not show any loading screens for it, so on initial page load it loads my content and sidebar first, and then loads the bacground image, so there is a little jump, I would like to only show the page after the background has been loaded.

Any help you can give me would be appreciated

0 Replies