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-apricotOP•2y 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:
but I would rather say that this is a bug and the loader shouldn't be rendered at all in those cases?deep-jade•2y ago
again something for @Tanner Linsley
vicious-gold•2y ago
Probably has to do with the initial states of matches
Are these matches using routes with lazy components?
correct-apricotOP•2y ago
In my code, yes. But the reproduction is without lazy route components
vicious-gold•2y ago
I’m looking into it ASAP
correct-apricotOP•2y 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 ...