I'm trying to build a simple app with Nextjs 13.4.9, and there's this weird behaviour I'm facing among loading.tsx
files while navigating between routes. It seems like when I navigate to a route which has a corresponding loading.tsx
file, instead of imidiately showing the corresponding loading.tsx
file from the route segment, for a split second it shows the loading.tsx
file from its parent route.
- app
- products
- laptop
page.tsx
loading.tsx
- smart-watch
page.tsx
loading.tsx
page.tsx
loading.tsx
- laptop
- products
So basically in a routing structure like above, when I navigate between /products/smart-watch
and /products/laptop
, for a brief moment is shows the loading.tsx
file from products
and then it switches to the loading.tsx
file from the route I'm trying to visit.
My code is as simple as it gets and they're all Server Components.
has anybody faced something like this ? Is it a bug or am I just missing something ?
I'd appreciate any help. Thanks