Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add known limitation about cancellation with suspense hooks #7958

Merged
merged 3 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/framework/react/guides/query-cancellation.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,8 @@ return (
```

[//]: # 'Example7'

## Limitations

Cancelation does not work when working with `Suspense` hooks: `useSuspenseQuery`, `useSuspenseQueries` and `useSuspenseInfiniteQuery`.

5 changes: 5 additions & 0 deletions docs/framework/react/reference/useSuspenseInfiniteQuery.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,8 @@ 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.

5 changes: 4 additions & 1 deletion docs/framework/react/reference/useSuspenseQueries.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ 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.

5 changes: 5 additions & 0 deletions docs/framework/react/reference/useSuspenseQuery.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@ 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.

Loading