How to render a loading component while fetching data with queryClient.ensureQueryData inside loader
using Await and defer is only way ?
4 Replies
wise-white•15mo ago
you just need to
await queryClient.ensureQueryData() inside the loaderwise-white•15mo ago
make sure your loader takes longer than https://tanstack.com/router/latest/docs/framework/react/api/router/RouteOptionsType#pendingms-property
RouteOptions type | TanStack Router React Docs
The RouteOptions type is used to describe the options that can be used when creating a route.
RouteOptions properties
sensitive-blueOP•15mo ago
delete await and set options then working.. delete await is fine?
wise-white•15mo ago
not sure what you mean
Can you please provide a minimal complete example, e.g. by forking one of the examples on stackblitz?