You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to implement a loading indicator inside of a part of my component. The tutorial I was following used pendingComponent() to show a loading indictator on the initial data fetch. This is not ideal for what I wanted to build off of it. I would like to take advantage of the SWR rendering, but also be able to place the loading indicator INSIDE my component, so that the indicator is inside the bounds where the content being loaded would exist.
The only way I can get anything close to this, is to write my template twice. Once with the data as the component and once inside the pendingComponent() function with the added loading indicator.
I have tried something along these lines to get the indicator to show up, however the indicator ALWAYS shows up, and that just completely voids the benefit of the built in SWR caching Tanstack provides, which is to use cached data to provide a more snappy user experience by removing the loading screens from subsequent navigations to the same route withthin the allotted stale data time:
Being able to show a loading indicator in the portion of a component where it would be displayed seems like a pretty obvious use case, so I am not sure if I am just missing something obvious. Maybe this is not a problem Tanstack Router was meant to solve.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to implement a loading indicator inside of a part of my component. The tutorial I was following used
pendingComponent()to show a loading indictator on the initial data fetch. This is not ideal for what I wanted to build off of it. I would like to take advantage of the SWR rendering, but also be able to place the loading indicator INSIDE my component, so that the indicator is inside the bounds where the content being loaded would exist.The only way I can get anything close to this, is to write my template twice. Once with the data as the
componentand once inside thependingComponent()function with the added loading indicator.I have tried something along these lines to get the indicator to show up, however the indicator ALWAYS shows up, and that just completely voids the benefit of the built in SWR caching Tanstack provides, which is to use cached data to provide a more snappy user experience by removing the loading screens from subsequent navigations to the same route withthin the allotted stale data time:
Beta Was this translation helpful? Give feedback.
All reactions