-
|
First thanks a lot for this marvelous library! I know the best way would be to use a loader at router level, but in not router related application parts, what is the good way to use suspense with both infinite and standard queries ?
const result = useSuspenseQuery(myQueryOptions)
const infiniteResult = useSuspenseInfiniteQuery(myInfiniteQueryOptions)
const queryClient = useQueryClient()
use(Promise.all([
// Preload without waterfall
queryClient.ensureQueryData(myQueryOptions),
queryClient.ensureInfiniteQueryData(myInfiniteQueryOptions),
]))
const result = useSuspenseQuery(myQueryOptions)
const infiniteResult = useSuspenseInfiniteQuery(myInfiniteQueryOptions)Any better way? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
splitting into siblings should work, if not, please show a reproduction.
We have a |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for you quick reply (on a Sunday)!
I'll investigate further for siblings, the most likely is that there's something wrong in my code. Thanks again! |
Beta Was this translation helpful? Give feedback.
splitting into siblings should work, if not, please show a reproduction.
We have a
usePrefetchQueryand ausePrefetchInfiniteQueryhook you could use instead.