Skip to content

Commit

Permalink
Merge remote-tracking branch 'tannerlinsley/main' into beta
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/ci-v3.yml
#	README.md
#	docs/src/pages/examples/auto-refetching.mdx
#	docs/src/pages/examples/basic-graphql-request.mdx
#	docs/src/pages/examples/basic.mdx
#	docs/src/pages/examples/custom-hooks.mdx
#	docs/src/pages/examples/default-query-function.mdx
#	docs/src/pages/examples/focus-refetching.mdx
#	docs/src/pages/examples/load-more-infinite-scroll.mdx
#	docs/src/pages/examples/nextjs.mdx
#	docs/src/pages/examples/optimistic-updates-typescript.mdx
#	docs/src/pages/examples/optimistic-updates.mdx
#	docs/src/pages/examples/pagination.mdx
#	docs/src/pages/examples/playground.mdx
#	docs/src/pages/examples/prefetching.mdx
#	docs/src/pages/examples/react-native.mdx
#	docs/src/pages/examples/rick-morty.mdx
#	docs/src/pages/examples/simple.mdx
#	docs/src/pages/examples/star-wars.mdx
#	docs/src/pages/examples/suspense.mdx
#	docs/src/pages/index.js
#	packages/query-core/src/types.ts
#	src/core/mutation.ts
  • Loading branch information
TkDodo committed Jul 14, 2022
2 parents 3ceb5ff + d83c404 commit 78e827d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/guides/suspense.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!

Expand Down
2 changes: 1 addition & 1 deletion docs/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion packages/query-core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ export interface MutationOptions<
onSuccess?: (
data: TData,
variables: TVariables,
context: TContext,
context: TContext | undefined,
) => Promise<unknown> | void
onError?: (
error: TError,
Expand Down

0 comments on commit 78e827d

Please sign in to comment.