diff --git a/docs/src/pages/docs/guides/mutations.md b/docs/src/pages/docs/guides/mutations.md index 52efc79d0da..e0720e7e245 100644 --- a/docs/src/pages/docs/guides/mutations.md +++ b/docs/src/pages/docs/guides/mutations.md @@ -78,7 +78,7 @@ const CreateTodo = () => { } ``` -Even with just variables, mutations aren't all that special, but when used with the `onSuccess` option, the [Query Cache's `invalidateQueries` method](#querycacheinvalidatequeries) and the [Query Cache's `setQueryData` method](#querycachesetquerydata), mutations become a very powerful tool. +Even with just variables, mutations aren't all that special, but when used with the `onSuccess` option, the [Query Cache's `invalidateQueries` method](../api#querycacheinvalidatequeries) and the [Query Cache's `setQueryData` method](../api/#querycachesetquerydata), mutations become a very powerful tool. Note that since version 1.1.0, the `mutate` function is no longer called synchronously so you cannot use it in an event callback. If you need to access the event in `onSubmit` you need to wrap `mutate` in another function. This is due to [React event pooling](https://reactjs.org/docs/events.html#event-pooling). diff --git a/docs/src/pages/docs/guides/prefetching.md b/docs/src/pages/docs/guides/prefetching.md index 0a3afd15951..ea6bed5a988 100644 --- a/docs/src/pages/docs/guides/prefetching.md +++ b/docs/src/pages/docs/guides/prefetching.md @@ -22,7 +22,7 @@ If a prefetched query is rendered after the `staleTime` for a prefetched query, ## Manually Priming a Query -Alternatively, if you already have the data for your query synchronously available, you don't need to prefetch it. You can just use the [Query Cache's `setQueryData` method](#querycachesetquerydata) to directly add or update a query's cached result. +Alternatively, if you already have the data for your query synchronously available, you don't need to prefetch it. You can just use the [Query Cache's `setQueryData` method](../api/#querycachesetquerydata) to directly add or update a query's cached result. ```js import { queryCache } from 'react-query' diff --git a/docs/src/pages/docs/guides/suspense.md b/docs/src/pages/docs/guides/suspense.md index 50bbe7325f5..3e430868469 100644 --- a/docs/src/pages/docs/guides/suspense.md +++ b/docs/src/pages/docs/guides/suspense.md @@ -64,4 +64,4 @@ import { ErrorBoundary } from "react-error-boundary"; ## Fetch-on-render vs Render-as-you-fetch -Out of the box, React Query in `suspense` mode works really well as a **Fetch-on-render** solution with no additional configuration. This means that when your components attempt to mount, they will trigger query fetching and suspend, but only once you have imported them and mounted them. If you want to take it to the next level and implement a **Render-as-you-fetch** model, we recommend implementing [Prefetching](#prefetching) on routing callbacks and/or user interactions events to start loading queries before they are mounted and hopefully even before you start importing or mounting their parent components. +Out of the box, React Query in `suspense` mode works really well as a **Fetch-on-render** solution with no additional configuration. This means that when your components attempt to mount, they will trigger query fetching and suspend, but only once you have imported them and mounted them. If you want to take it to the next level and implement a **Render-as-you-fetch** model, we recommend implementing [Prefetching](./prefetching) on routing callbacks and/or user interactions events to start loading queries before they are mounted and hopefully even before you start importing or mounting their parent components. diff --git a/docs/src/pages/docs/guides/updates-from-mutation-responses.md b/docs/src/pages/docs/guides/updates-from-mutation-responses.md index 899a162d8ac..42f22a81529 100644 --- a/docs/src/pages/docs/guides/updates-from-mutation-responses.md +++ b/docs/src/pages/docs/guides/updates-from-mutation-responses.md @@ -3,7 +3,7 @@ id: updates-from-mutation-responses title: Updates from Mutation Responses --- -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 Cache's `setQueryData`](#querycachesetquerydata) method: +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 Cache's `setQueryData`](../api#querycachesetquerydata) method: ```js const [mutate] = useMutation(editTodo, {