How does loading.tsx work?
Unanswered
Sun bear posted this in #help-forum
Sun bearOP
I have a route
since I know that there are pages that are not entirely dynamic meaning they are set in stone, but the way we architecture it is that they are also composable in our CMS, I created another loading.tsx file under those specific route. For example, we have an about-us page, what I did was let the
and added loading.tsx under
app/(marketing)/[slug]/page.tsx + loading.tsx -> this purpose is to provide skeleton for a dynamic page from our CMSsince I know that there are pages that are not entirely dynamic meaning they are set in stone, but the way we architecture it is that they are also composable in our CMS, I created another loading.tsx file under those specific route. For example, we have an about-us page, what I did was let the
app/(marketing)/[slug]/page.tsx handle the rendering of the page itselfand added loading.tsx under
app/about-us/loading.tsx like that since I know that's the route, but it doesn't use the about-us loader but instead is using the marketing dynamic route loader instead. How should I fix this?3 Replies
Sun bearOP
I could try adding and fetching the page there directly at app/about-us/page.tsx
but I'm just thinking if loading.tsx should respect the routing and what to use if we explicitly provide one for specific route
but I'm just thinking if loading.tsx should respect the routing and what to use if we explicitly provide one for specific route
If not working try adding layout.tsx in /(marketing)