T
TanStack•4mo ago
continuing-cyan

What is the tanstack way of doing loading? (Example: Next.js has loading.tsx)

Is there a way i can add a loader to a specific road that does server-side loader?
4 Replies
harsh-harlequin
harsh-harlequin•4mo ago
are you looking for deferred loading? you can use Await or just React.use. this will suspend your route component and then should cause the pending component to be rendered
continuing-cyan
continuing-cyanOP•4mo ago
aha thanks! 😄 Yeah, deferred loading 🙂
ambitious-aqua
ambitious-aqua•4mo ago
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 The RouteOptions type accepts an object with the following properties: getParentRo...
ambitious-aqua
ambitious-aqua•4mo ago
And useSuspenseQuery should use it properly too

Did you find this page helpful?