T
TanStack3y ago
quickest-silver

pendingComponent - not rendered

Hey folks, Before creating an issue, I kinda want to check if I'm just doing something wrong on my end: I'm on beta.86, trying to get a loading spinner to render while my loader is loading. Added the pendingComponent to my route but nothing is rendering while it loads. What I tried: - Add wrapInSuspense: true|false to itself and higher level routes - Add a defaultPendingComponent to the router instance. I tried the React Example: With Trpc after fixing it up and dowgrading it to 86 (https://stackblitz.com/edit/tanstack-router-qrmscu?file=package.json), but I only see the small, local, spinners?
StackBlitz
Router With Trpc Example (forked) - StackBlitz
Run official live example code for Router With Trpc, created by Tanstack on StackBlitz
4 Replies
complex-teal
complex-teal3y ago
Same here, I don't see any render of any pendingComponent... Is there a version where this feature is ok ?
quickest-silver
quickest-silverOP3y ago
So after some testing, it seems pendingComponent is only rendered when the actual route component is lazy loaded (via React.lazy). I'm not sure if that is expected behaviour, I would've thought it should also render when the loader of the route is not ready yet...
stormy-gold
stormy-gold3y ago
This seems intuitive, actually looking for this functionality too. Currently in beta-86 and it's not working as you described here.
quickest-silver
quickest-silverOP3y ago
Yea I think it was also broken in latest beta, has to downgrade to get it working AFAIK Nut sure which exact Version tho

Did you find this page helpful?