You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For more information, check out the [NextJs Suspense Streaming Example](../examples/nextjs-suspense-streaming).
424
+
For more information, check out the [NextJs Suspense Streaming Example](../../examples/nextjs-suspense-streaming).
425
425
426
426
The big upside is that you no longer need to prefetch queries manually to have SSR work, and it even still streams in the result! This gives you phenomenal DX and lower code complexity.
Copy file name to clipboardExpand all lines: docs/framework/react/guides/caching.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ Let's assume we are using the default `gcTime` of **5 minutes** and the default
23
23
- A second instance of `useQuery({ queryKey: ['todos'], queryFn: fetchTodos })` mounts elsewhere.
24
24
- Since the cache already has data for the `['todos']` key from the first query, that data is immediately returned from the cache.
25
25
- The new instance triggers a new network request using its query function.
26
-
- Note that regardless of whether both `fetchTodos` query functions are identical or not, both queries' [`status`](../useQuery) are updated (including `isFetching`, `isPending`, and other related values) because they have the same query key.
26
+
- Note that regardless of whether both `fetchTodos` query functions are identical or not, both queries' [`status`](../../reference/useQuery) are updated (including `isFetching`, `isPending`, and other related values) because they have the same query key.
27
27
- When the request completes successfully, the cache's data under the `['todos']` key is updated with the new data, and both instances are updated with the new data.
28
28
- Both instances of the `useQuery({ queryKey: ['todos'], queryFn: fetchTodos })` query are unmounted and no longer in use.
29
29
- Since there are no more active instances of this query, a garbage collection timeout is set using `gcTime` to delete and garbage collect the query (defaults to **5 minutes**).
Copy file name to clipboardExpand all lines: docs/framework/react/guides/initial-query-data.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -170,6 +170,6 @@ const result = useQuery({
170
170
171
171
## Further reading
172
172
173
-
For a comparison between `Initial Data` and `Placeholder Data`, have a look at the [Community Resources](../tkdodos-blog#9-placeholder-and-initial-data-in-react-query).
173
+
For a comparison between `Initial Data` and `Placeholder Data`, have a look at the [Community Resources](../../community/tkdodos-blog#9-placeholder-and-initial-data-in-react-query).
Copy file name to clipboardExpand all lines: docs/framework/react/guides/migrating-to-react-query-3.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -103,8 +103,8 @@ try {
103
103
104
104
Together, these provide the same experience as before, but with added control to choose which component trees you want to reset. For more information, see:
Copy file name to clipboardExpand all lines: docs/framework/react/guides/migrating-to-react-query-4.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -134,7 +134,7 @@ The `useQueries` hook now accepts an object with a `queries` prop as its input.
134
134
135
135
### Undefined is an illegal cache value for successful queries
136
136
137
-
In order to make bailing out of updates possible by returning `undefined`, we had to make `undefined` an illegal cache value. This is in-line with other concepts of react-query, for example, returning `undefined` from the [initialData function](guides/initial-query-data#initial-data-function) will also _not_ set data.
137
+
In order to make bailing out of updates possible by returning `undefined`, we had to make `undefined` an illegal cache value. This is in-line with other concepts of react-query, for example, returning `undefined` from the [initialData function](../initial-query-data#initial-data-function) will also _not_ set data.
138
138
139
139
Further, it is an easy bug to produce `Promise<void>` by adding logging in the queryFn:
140
140
@@ -234,7 +234,7 @@ The filter defaults to `all`, and you can choose to only match `active` or `inac
234
234
235
235
#### refetchActive / refetchInactive
236
236
237
-
[queryClient.invalidateQueries](../../../reference/QueryClient/#queryclientinvalidatequeries) had two additional, similar flags:
237
+
[queryClient.invalidateQueries](../../../../reference/QueryClient/#queryclientinvalidatequeries) had two additional, similar flags:
### `persistQueryClient` and the corresponding persister plugins are no longer experimental and have been renamed
274
274
275
-
The plugins `createWebStoragePersistor` and `createAsyncStoragePersistor` have been renamed to [`createSyncStoragePersister`](../plugins/createSyncStoragePersister) and [`createAsyncStoragePersister`](../plugins/createAsyncStoragePersister) respectively. The interface `Persistor` in `persistQueryClient` has also been renamed to `Persister`. Checkout [this stackexchange](https://english.stackexchange.com/questions/206893/persister-or-persistor) for the motivation of this change.
275
+
The plugins `createWebStoragePersistor` and `createAsyncStoragePersistor` have been renamed to [`createSyncStoragePersister`](../../plugins/createSyncStoragePersister) and [`createAsyncStoragePersister`](../../plugins/createAsyncStoragePersister) respectively. The interface `Persistor` in `persistQueryClient` has also been renamed to `Persister`. Checkout [this stackexchange](https://english.stackexchange.com/questions/206893/persister-or-persistor) for the motivation of this change.
276
276
277
277
Since these plugins are no longer experimental, their import paths have also been updated:
278
278
@@ -296,7 +296,7 @@ Types now require using TypeScript v4.1 or greater
296
296
297
297
### Supported Browsers
298
298
299
-
As of v4, React Query is optimized for modern browsers. We have updated our browserslist to produce a more modern, performant and smaller bundle. You can read about the requirements [here](./installation#requirements).
299
+
As of v4, React Query is optimized for modern browsers. We have updated our browserslist to produce a more modern, performant and smaller bundle. You can read about the requirements [here](../../installation#requirements).
300
300
301
301
### `setLogger` is removed
302
302
@@ -419,7 +419,7 @@ React Query defaults to "tracking" query properties, which should give you a nic
419
419
420
420
### Bailing out of updates with setQueryData
421
421
422
-
When using the [functional updater form of setQueryData](../../../reference/QueryClient/#queryclientsetquerydata), you can now bail out of the update by returning `undefined`. This is helpful if `undefined` is given to you as `previousValue`, which means that currently, no cached entry exists and you don't want to / cannot create one, like in the example of toggling a todo:
422
+
When using the [functional updater form of setQueryData](../../../../reference/QueryClient/#queryclientsetquerydata), you can now bail out of the update by returning `undefined`. This is helpful if `undefined` is given to you as `previousValue`, which means that currently, no cached entry exists and you don't want to / cannot create one, like in the example of toggling a todo:
Copy file name to clipboardExpand all lines: docs/framework/react/guides/migrating-to-v5.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -186,7 +186,7 @@ Custom loggers were already deprecated in 4 and have been removed in this versio
186
186
187
187
### Supported Browsers
188
188
189
-
We have updated our browserslist to produce a more modern, performant and smaller bundle. You can read about the requirements [here](./installation#requirements).
189
+
We have updated our browserslist to produce a more modern, performant and smaller bundle. You can read about the requirements [here](../../installation#requirements).
190
190
191
191
### Private class fields and methods
192
192
@@ -235,7 +235,7 @@ useQuery<number, string>({
235
235
})
236
236
```
237
237
238
-
For a way to set a different kind of Error globally, see [the TypeScript Guide](./typescript#registering-a-global-error).
238
+
For a way to set a different kind of Error globally, see [the TypeScript Guide](../../typescript#registering-a-global-error).
239
239
240
240
### eslint `prefer-query-object-syntax` rule is removed
241
241
@@ -488,17 +488,17 @@ Infinite Queries can be prefetched like regular Queries. Per default, only the f
488
488
489
489
### New `combine` option for `useQueries`
490
490
491
-
See the [useQueries docs](../useQueries#combine) for more details.
491
+
See the [useQueries docs](../../reference/useQueries#combine) for more details.
492
492
493
493
### Experimental `fine grained storage persister`
494
494
495
-
See the [experimental_createPersister docs](../plugins/createPersister) for more details.
495
+
See the [experimental_createPersister docs](../../plugins/createPersister) for more details.
496
496
497
497
[//]: #'FrameworkSpecificNewFeatures'
498
498
499
499
### Typesafe way to create Query Options
500
500
501
-
See the [TypeScript docs](./typescript#typing-query-options) for more details.
501
+
See the [TypeScript docs](../../typescript#typing-query-options) for more details.
Copy file name to clipboardExpand all lines: docs/framework/react/guides/mutations.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,7 +59,7 @@ Beyond those primary states, more information is available depending on the stat
59
59
60
60
In the example above, you also saw that you can pass variables to your mutations function by calling the `mutate` function with a **single variable or object**.
61
61
62
-
Even with just variables, mutations aren't all that special, but when used with the `onSuccess` option, the [Query Client's `invalidateQueries` method](../../../reference/QueryClient/#queryclientinvalidatequeries) and the [Query Client's `setQueryData` method](../../../reference/QueryClient/#queryclientsetquerydata), mutations become a very powerful tool.
62
+
Even with just variables, mutations aren't all that special, but when used with the `onSuccess` option, the [Query Client's `invalidateQueries` method](../../../../reference/QueryClient/#queryclientinvalidatequeries) and the [Query Client's `setQueryData` method](../../../../reference/QueryClient/#queryclientsetquerydata), mutations become a very powerful tool.
If you persist offline mutations with the [persistQueryClient plugin](../persistQueryClient), mutations cannot be resumed when the page is reloaded unless you provide a default mutation function.
346
+
If you persist offline mutations with the [persistQueryClient plugin](../../plugins/persistQueryClient), mutations cannot be resumed when the page is reloaded unless you provide a default mutation function.
347
347
348
348
This is a technical limitation. When persisting to an external storage, only the state of mutations is persisted, as functions cannot be serialized. After hydration, the component that triggers the mutation might not be mounted, so calling `resumePausedMutations` might yield an error: `No mutationFn found`.
349
349
@@ -386,13 +386,13 @@ export default function App() {
386
386
387
387
[//]: #'Example11'
388
388
389
-
We also have an extensive [offline example](../examples/offline) that covers both queries and mutations.
389
+
We also have an extensive [offline example](../../examples/offline) that covers both queries and mutations.
390
390
391
391
[//]: #'Materials'
392
392
393
393
## Further reading
394
394
395
-
For more information about mutations, have a look at [#12: Mastering Mutations in React Query](../tkdodos-blog#12-mastering-mutations-in-react-query) from
395
+
For more information about mutations, have a look at [#12: Mastering Mutations in React Query](../../community/tkdodos-blog#12-mastering-mutations-in-react-query) from
0 commit comments