How to render a loading component while fetching data with queryClient.ensureQueryData inside loader
using Await and defer is only way ?
4 Replies
harsh-harlequin•12mo ago
you just need to
await queryClient.ensureQueryData()
inside the loaderharsh-harlequin•12mo 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
conscious-sapphireOP•12mo ago
delete await and set options then working.. delete await is fine?
harsh-harlequin•12mo ago
not sure what you mean
Can you please provide a minimal complete example, e.g. by forking one of the examples on stackblitz?