Suspended queries in route
I have a root route with a default pending component.
A child route defines a loader using ensureQueryData from tanstack query. I'm using the default pendingMs and pendingMinMs which is working as expected.
In the child route, i'm using a useSuspenseQuery hook to fetch data based on some conditions. (I can't use the loader in this case because i'm staying on the same route)
When the useSuspenseQuery hook is fetching data, the default pending component is shown, because it triggers the suspense boundary from the root route? (which causes a flash of the default pending component)
I want to use the same principle of the pending component like with the route properties loader, but for the useSuspenseQuery hook.
I don't want the pending component to be shown when the useSuspenseQuery hook is fetching data from at least 1second but when it does show, atleast for 500ms (default router behaviour)
Is this possible?
1 Reply
automatic-azure•12mo ago
(I can't use the loader in this case because i'm staying on the same routewhich conditions are those? query / path params?