Next.js Discord

Discord Forum

How to handle loading states in layout.tsx?

Unanswered
Cairn Terrier posted this in #help-forum
Open in Discord
Cairn TerrierOP
I have dynamic pages items/[item] and I have more subpages such as items/[items]/about and items/[items]/more. So in items/[item] I have a layout.tsx file that has a header with the item name etc. Because I am fetching data in the layout file, I want to show a loading skeleton similar to how we normally do with loading.tsx for a page. How should I go about this? Should I use a parallel route or do something else for better performance?

3 Replies