Skip to content

Commit 0123c80

Browse files
authored
docs: gcTime max value (#7190)
1 parent 9e70983 commit 0123c80

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

docs/framework/react/plugins/persistQueryClient.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ It should be set as the same value or higher than persistQueryClient's `maxAge`
2121

2222
You can also pass it `Infinity` to disable garbage collection behavior entirely.
2323

24+
Due to a Javascript limitation, the maximum allowed `gcTime` is about 24 days (see [more](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout#maximum_delay_value)).
25+
2426
```tsx
2527
const queryClient = new QueryClient({
2628
defaultOptions: {

docs/framework/react/reference/useMutation.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ mutate(variables, {
5151
- `gcTime: number | Infinity`
5252
- The time in milliseconds that unused/inactive cache data remains in memory. When a mutation's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different cache times are specified, the longest one will be used.
5353
- If set to `Infinity`, will disable garbage collection
54+
- Note: the maximum allowed time is about 24 days. See [more](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout#maximum_delay_value).
5455
- `mutationKey: unknown[]`
5556
- Optional
5657
- A mutation key can be set to inherit defaults set with `queryClient.setMutationDefaults`.

docs/framework/react/reference/useQuery.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ const {
9696
- `gcTime: number | Infinity`
9797
- Defaults to `5 * 60 * 1000` (5 minutes) or `Infinity` during SSR
9898
- The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used.
99+
- Note: the maximum allowed time is about 24 days. See [more](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout#maximum_delay_value).
99100
- If set to `Infinity`, will disable garbage collection
100101
- `queryKeyHashFn: (queryKey: QueryKey) => string`
101102
- Optional

0 commit comments

Comments
 (0)