From 804357b9352d3fc39855ead9b60a39028ba6e3a3 Mon Sep 17 00:00:00 2001 From: Romain Trotard Date: Tue, 27 Aug 2024 18:23:55 +0200 Subject: [PATCH] docs: Add known limitation about cancellation with suspense hooks (#7958) * docs: Add known limitation about cancellation with suspense hooks * ci: apply automated fixes --------- Co-authored-by: Dominik Dorfmeister Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> --- docs/framework/react/guides/query-cancellation.md | 4 ++++ docs/framework/react/reference/useSuspenseInfiniteQuery.md | 4 ++++ docs/framework/react/reference/useSuspenseQueries.md | 4 +++- docs/framework/react/reference/useSuspenseQuery.md | 4 ++++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/framework/react/guides/query-cancellation.md b/docs/framework/react/guides/query-cancellation.md index 3e8545c0aa..efbf0eb351 100644 --- a/docs/framework/react/guides/query-cancellation.md +++ b/docs/framework/react/guides/query-cancellation.md @@ -187,3 +187,7 @@ return ( ``` [//]: # 'Example7' + +## Limitations + +Cancelation does not work when working with `Suspense` hooks: `useSuspenseQuery`, `useSuspenseQueries` and `useSuspenseInfiniteQuery`. diff --git a/docs/framework/react/reference/useSuspenseInfiniteQuery.md b/docs/framework/react/reference/useSuspenseInfiniteQuery.md index 06e81cbb23..0f69233d6d 100644 --- a/docs/framework/react/reference/useSuspenseInfiniteQuery.md +++ b/docs/framework/react/reference/useSuspenseInfiniteQuery.md @@ -24,3 +24,7 @@ Same object as [useInfiniteQuery](../useInfiniteQuery), except that: - `isPlaceholderData` is missing - `status` is always `success` - the derived flags are set accordingly. + +**Caveat** + +[Cancelation](../guides/query-cancellation.md) does not work. diff --git a/docs/framework/react/reference/useSuspenseQueries.md b/docs/framework/react/reference/useSuspenseQueries.md index 549bfe9022..7da4f3fb48 100644 --- a/docs/framework/react/reference/useSuspenseQueries.md +++ b/docs/framework/react/reference/useSuspenseQueries.md @@ -25,6 +25,8 @@ Same structure as [useQueries](../useQueries), except that for each `query`: - `status` is always `success` - the derived flags are set accordingly. -**Caveat** +**Caveats** Keep in mind that the component will only re-mount after **all queries** have finished loading. Hence, if a query has gone stale in the time it took for all the queries to complete, it will be fetched again at re-mount. To avoid this, make sure to set a high enough `staleTime`. + +[Cancelation](../guides/query-cancellation.md) does not work. diff --git a/docs/framework/react/reference/useSuspenseQuery.md b/docs/framework/react/reference/useSuspenseQuery.md index 7bb04f60e5..3c2ab660eb 100644 --- a/docs/framework/react/reference/useSuspenseQuery.md +++ b/docs/framework/react/reference/useSuspenseQuery.md @@ -23,3 +23,7 @@ Same object as [useQuery](../useQuery), except that: - `isPlaceholderData` is missing - `status` is always `success` - the derived flags are set accordingly. + +**Caveat** + +[Cancelation](../guides/query-cancellation.md) does not work.