T
TanStack2y ago
correct-apricot

defaultPendingComponent shown for routes that have no loader specified

See this reproduction: https://stackblitz.com/edit/tanstack-router-mbfafp?file=src%2Fmain.tsx Even if I have no loader specified, the defaultPendingComponent is briefly rendered, and thus sometimes visible. This becomes more obvious when defaultPendingMs is set to zero - we will see the (unnecessary) pending component for half a second (the default of defaultPendingMinMs) I think the pending component should only be rendered for routes that have a loader, right?
Dominik Dorfmeister
StackBlitz
Router Quickstart File Based Example (forked) - StackBlitz
Run official live example code for Router Quickstart File Based, created by Tanstack on StackBlitz
6 Replies
correct-apricot
correct-apricotOP2y ago
I can set defaultPendingMinMs to zero as well; however, this sometimes makes the loader flash for me. A setting that seems to work well is:
defaultPendingMinMs: 0,
defaultPendingMs: 50,
defaultPendingMinMs: 0,
defaultPendingMs: 50,
but I would rather say that this is a bug and the loader shouldn't be rendered at all in those cases?
deep-jade
deep-jade2y ago
again something for @Tanner Linsley
vicious-gold
vicious-gold2y ago
Probably has to do with the initial states of matches Are these matches using routes with lazy components?
correct-apricot
correct-apricotOP2y ago
In my code, yes. But the reproduction is without lazy route components
vicious-gold
vicious-gold2y ago
I’m looking into it ASAP
correct-apricot
correct-apricotOP2y ago
I created an issue for this: https://github.com/TanStack/router/issues/1349 seems like most of my findings are tied to defaultPendingMs: 0 😅 .
GitHub
pending component is rendered for routes that have no loader · Issu...
Describe the bug A route that has no loader shouldn't show the pending component - yet the pendingComponent is rendered for defaultPendingMinMs even if it has no loader. To see this we need to ...

Did you find this page helpful?