Replies: 5 comments 2 replies
-
I have the same problem |
Beta Was this translation helpful? Give feedback.
-
Hey I just answered a similar question. Checkout
|
Beta Was this translation helpful? Give feedback.
-
I would add my vote to this feature request. I find myself needing a loading page for a layout which makes a fetch request, but having to do it manually and thus having to make it a client component. |
Beta Was this translation helpful? Give feedback.
-
I think the bigger issue I struggle with is that the filesystem approach to loading/error components separates my happy path from my unhappy path. I want to push loading and error states to the leag components of my pages. This pattern helps minimize layout content shift, since all layout (not just layout components) are shared by the happy and unhappy path for each component. This is more in line with the Mui Skeleton approach. The trouble is this requires downloading the whole bundle. |
Beta Was this translation helpful? Give feedback.
-
I kinda found a work around which is to wrap my layout in a suspens in another parent layout.
Work not too bad even if it's not working for every cases |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently
loading.tsx
apparently only supportspage.tsx
, so something like this won't workIf I use some expensive data fetching method in
layout.tsx
, likegetUser()
, I can't use thisloading.tsx
to display an instant loading state. I need to manually do it likeBut
loading.tsx
for layout may conflict with aloading.tsx
for page, so probably a different naming convention is necessary.So feature request:
layout-loading.tsx
to display instant loading state forlayout.tsx
.Beta Was this translation helpful? Give feedback.
All reactions