diff --git a/docs/guides/suspense.md b/docs/guides/suspense.md index 8e268ad164..3cc603bf9d 100644 --- a/docs/guides/suspense.md +++ b/docs/guides/suspense.md @@ -39,7 +39,7 @@ import { useQuery } from '@tanstack/react-query' useQuery(queryKey, queryFn, { suspense: true }) ``` -When using suspense mode, `status` states and `error` objects are not needed and are then replaced by usage of the `React.Suspense` component (including the use of the `fallback` prop and React error boundaries for catching errors). Please read the [Resetting Error Boundaries](#resetting-error-boundaries) and look at the [Suspense Example](https://codesandbox.io/s/github/tannerlinsley/react-query/tree/master/examples/suspense) for more information on how to set up suspense mode. +When using suspense mode, `status` states and `error` objects are not needed and are then replaced by usage of the `React.Suspense` component (including the use of the `fallback` prop and React error boundaries for catching errors). Please read the [Resetting Error Boundaries](#resetting-error-boundaries) and look at the [Suspense Example](https://codesandbox.io/s/github/tannerlinsley/react-query/tree/main/examples/suspense) for more information on how to set up suspense mode. In addition to queries behaving differently in suspense mode, mutations also behave a bit differently. By default, instead of supplying the `error` variable when a mutation fails, it will be thrown during the next render of the component it's used in and propagate to the nearest error boundary, similar to query errors. If you wish to disable this, you can set the `useErrorBoundary` option to `false`. If you wish that errors are not thrown at all, you can set the `throwOnError` option to `false` as well! diff --git a/docs/overview.md b/docs/overview.md index d59f4377ef..fd6a96e515 100644 --- a/docs/overview.md +++ b/docs/overview.md @@ -44,7 +44,7 @@ On a more technical note, React Query will likely: In the example below, you can see React Query in its most basic and simple form being used to fetch the GitHub stats for the React Query GitHub project itself: -[Open in CodeSandbox](https://codesandbox.io/s/github/tannerlinsley/react-query/tree/master/examples/simple) +[Open in CodeSandbox](https://codesandbox.io/s/github/tannerlinsley/react-query/tree/main/examples/simple) ```js import { QueryClient, QueryClientProvider, useQuery } from '@tanstack/react-query' diff --git a/packages/query-core/src/types.ts b/packages/query-core/src/types.ts index 55d1f78625..ad8188e9f0 100644 --- a/packages/query-core/src/types.ts +++ b/packages/query-core/src/types.ts @@ -534,7 +534,7 @@ export interface MutationOptions< onSuccess?: ( data: TData, variables: TVariables, - context: TContext, + context: TContext | undefined, ) => Promise | void onError?: ( error: TError,