staleTime is 0, which means we at least get a background fetch any time there's a new component subscribing to some query. It's a pretty good default a lot of the time because it ensures the user is getting the latest data any time a new component mounts that needs it.<QuerySuspended/> shows some loading state when a query is still loading, and can also handle error states.Foo and Bar don't have to worry about treating the data asynchronously since by the time they render the data is already loaded.<QuerySuspended/>const query = api.router.get.useQuery()
const {data} = query;
return (
<QuerySuspended queries={[query]}>
{data &&
<InnerComponent data={data}/>
}
</QuerySuspended>
)