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
Copy file name to clipboardExpand all lines: docs/framework/react/guides/migrating-to-react-query-3.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
@@ -103,7 +103,7 @@ 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:
### `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`](../createSyncStoragePersister) and [`createAsyncStoragePersister`](../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
@@ -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](../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/mutations.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
@@ -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](../QueryClient#queryclientinvalidatequeries) and the [Query Client's `setQueryData` method](../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.
Copy file name to clipboardExpand all lines: docs/framework/react/guides/prefetching.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
@@ -426,7 +426,7 @@ Integration with other routers is also possible, see the [React Router example](
426
426
427
427
## Manually Priming a Query
428
428
429
-
If you already have the data for your query synchronously available, you don't need to prefetch it. You can just use the [Query Client's `setQueryData` method](../QueryClient#queryclientsetquerydata) to directly add or update a query's cached result by key.
429
+
If you already have the data for your query synchronously available, you don't need to prefetch it. You can just use the [Query Client's `setQueryData` method](../../../reference/QueryClient/#queryclientsetquerydata) to directly add or update a query's cached result by key.
Copy file name to clipboardExpand all lines: docs/framework/react/guides/ssr.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
@@ -548,7 +548,7 @@ On the server, `gcTime` defaults to `Infinity` which disables manual garbage col
548
548
549
549
Avoid setting `gcTime` to `0` as it may result in a hydration error. This occurs because the [Hydration Boundary](../hydration#hydrationboundary) places necessary data into the cache for rendering, but if the garbage collector removes the data before the rendering completes, issues may arise. If you require a shorter `gcTime`, we recommend setting it to `2 * 1000` to allow sufficient time for the app to reference the data.
550
550
551
-
To clear the cache after it is not needed and to lower memory consumption, you can add a call to [`queryClient.clear()`](../QueryClient#queryclientclear) after the request is handled and dehydrated state has been sent to the client.
551
+
To clear the cache after it is not needed and to lower memory consumption, you can add a call to [`queryClient.clear()`](../../../reference/QueryClient/#queryclientclear) after the request is handled and dehydrated state has been sent to the client.
When dealing with mutations that **update** objects on the server, it's common for the new object to be automatically returned in the response of the mutation. Instead of refetching any queries for that item and wasting a network call for data we already have, we can take advantage of the object returned by the mutation function and update the existing query with the new data immediately using the [Query Client's `setQueryData`](../QueryClient#queryclientsetquerydata) method:
6
+
When dealing with mutations that **update** objects on the server, it's common for the new object to be automatically returned in the response of the mutation. Instead of refetching any queries for that item and wasting a network call for data we already have, we can take advantage of the object returned by the mutation function and update the existing query with the new data immediately using the [Query Client's `setQueryData`](../../../reference/QueryClient/#queryclientsetquerydata) method:
For this use-case, you can use the `PersistQueryClientProvider`. It will make sure to subscribe / unsubscribe correctly according to the React component lifecycle, and it will also make sure that queries will not start fetching while we are still restoring. Queries will still render though, they will just be put into `fetchingState: 'idle'` until data has been restored. Then, they will refetch unless the restored data is _fresh_ enough, and _initialData_ will also be respected. It can be used _instead of_ the normal [QueryClientProvider](../QueryClientProvider):
183
+
For this use-case, you can use the `PersistQueryClientProvider`. It will make sure to subscribe / unsubscribe correctly according to the React component lifecycle, and it will also make sure that queries will not start fetching while we are still restoring. Queries will still render though, they will just be put into `fetchingState: 'idle'` until data has been restored. Then, they will refetch unless the restored data is _fresh_ enough, and _initialData_ will also be respected. It can be used _instead of_ the normal [QueryClientProvider](../reference/QueryClientProvider):
-**Required, but only if no default query function has been defined** See [Default Query Function](../default-query-function) for more information.
69
+
-**Required, but only if no default query function has been defined** See [Default Query Function](../../guides/default-query-function) for more information.
70
70
- The function that the query will use to request data.
71
71
- Receives a [QueryFunctionContext](../query-functions#queryfunctioncontext)
72
72
- Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`.
0 commit comments