loading.tsx ignored when using dynamic routes #59627
Replies: 5 comments 2 replies
-
|
I am also facing the same issue. |
Beta Was this translation helpful? Give feedback.
-
|
I am also experiencing this issue. |
Beta Was this translation helpful? Give feedback.
-
|
In case anyone is looking for a temp workaround. Using the Suspense fallback pattern appears to work instead of using the loading.tsx file. Just rename loading.tsx to something like LoadingUI.tsx For example: |
Beta Was this translation helpful? Give feedback.
-
|
I'm having the same issue with loading text. I think it's a problem on this loading part. |
Beta Was this translation helpful? Give feedback.
-
|
So i found workaround for this behavior At first i had such folder structure When i navigated to To fix it i made folder structure to look like this: I moved loader into And i added a key to the After this changes loader for |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
When using dynamic routes, the dynamic route loading state looks for the closest parent loading state. That causes the routes under the dynamic route to render the parent loading.tsx rather than their own loading.tsx
We have these files:
app/dashboard/loading.tsxapp/dashboard/[slug]/monitor/page.tsxapp/dashboard/[slug]/monitor/loading.tsx-> when routing to
app/dashboard/[slug]/monitor/page.tsx, the correspondingapp/dashboard/[slug]/monitor/loading.tsxdoes not get loaded. Rather, the dashboardapp/dashboard/loading.tsxgets loaded, which is the nearest parent loading.tsx for [slug] folder.Shoud I open a bug report or am I missing something?
Beta Was this translation helpful? Give feedback.
All reactions