T
TanStack•2y ago
deep-jade

Pending component for layout routes

How does setting a pending component on a layout route work? If I have a loader in the layout route and loaders in the child routes, will it display the pending component until all loaders finish or just the layout loaders?
2 Replies
automatic-azure
automatic-azure•2y ago
you could try it out 😀
deep-jade
deep-jadeOP•2y ago
😅 I did but was getting some confusing results. Just wanted to get some clarification on how it works. I have a pending component on the layout component which is just a simple spinner and no pending components on the child routes.
- layout with pending component
- index
- other routes

all routes have loaders
- layout with pending component
- index
- other routes

all routes have loaders
The spinner seems to be displaying for the child routes while they're loading but seems to be unmounting and mounting again which causes a reset of the animation. Any ideas why that's happening? I have removed react strict mode and it still occurs.

Did you find this page helpful?