Skip to content

Commit 705e640

Browse files
committed
docs(react-query): usePrefetchQueries docs
1 parent 728eaa8 commit 705e640

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/framework/react/guides/prefetching.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ This starts fetching `'article-comments'` immediately and flattens the waterfall
196196

197197
[//]: # 'Suspense'
198198

199-
If you want to prefetch together with Suspense, you will have to do things a bit differently. You can't use `useSuspenseQueries` to prefetch, since the prefetch would block the component from rendering. You also can not use `useQuery` for the prefetch, because that wouldn't start the prefetch until after suspenseful query had resolved. For this scenario, you can use the [`usePrefetchQuery`](../../reference/usePrefetchQuery) or the [`usePrefetchInfiniteQuery`](../../reference/usePrefetchInfiniteQuery) hooks available in the library.
199+
If you want to prefetch together with Suspense, you will have to do things a bit differently. You can't use `useSuspenseQueries` to prefetch, since the prefetch would block the component from rendering. You also can not use `useQuery` for the prefetch, because that wouldn't start the prefetch until after suspenseful query had resolved. For this scenario, you can use the [`usePrefetchQuery`](../../reference/usePrefetchQuery), the [`usePrefetchQueries`](../../reference/usePrefetchQueries) or the [`usePrefetchInfiniteQuery`](../../reference/usePrefetchInfiniteQuery) hooks available in the library.
200200

201201
You can now use `useSuspenseQuery` in the component that actually needs the data. You _might_ want to wrap this later component in its own `<Suspense>` boundary so the "secondary" query we are prefetching does not block rendering of the "primary" data.
202202

@@ -256,7 +256,7 @@ useEffect(() => {
256256

257257
To recap, if you want to prefetch a query during the component lifecycle, there are a few different ways to do it, pick the one that suits your situation best:
258258

259-
- Prefetch before a suspense boundary using `usePrefetchQuery` or `usePrefetchInfiniteQuery` hooks
259+
- Prefetch before a suspense boundary using `usePrefetchQuery`, `usePrefetchQueries` or `usePrefetchInfiniteQuery` hooks
260260
- Use `useQuery` or `useSuspenseQueries` and ignore the result
261261
- Prefetch inside the query function
262262
- Prefetch in an effect

0 commit comments

Comments
 (0)