Open History to see the last commit
1---
2id: QueryErrorResetBoundary
3title: QueryErrorResetBoundary
4redirect_from:
5 - framework/react/reference/QueryErrorResetBoundary
6---
7β
8```ts
9function QueryErrorResetBoundary(__namedParameters: QueryErrorResetBoundaryProps): Element;
10```
11β
12Defined in: [packages/react-query/src/QueryErrorResetBoundary.tsx:136](https://github.com/TanStack/query/blob/main/packages/react-query/src/QueryErrorResetBoundary.tsx#L136)
13β
14When using `suspense` or `throwOnError` in your queries, you need a way to let queries know that you want to
15try again when re-rendering after some error occurred. With the `QueryErrorResetBoundary` component you can
16reset any query errors within the boundaries of the component.
17β
18## Parameters
19β
20### \_\_namedParameters
21β
22[`QueryErrorResetBoundaryProps`](../interfaces/QueryErrorResetBoundaryProps.md)
23β
24## Returns
25β
26`Element`
27β
28The `children`, rendered as-is, or called with the boundary's QueryErrorResetBoundaryValue
29if `children` is a function.
30β
31## Example
32β
33```tsx
34import { ErrorBoundary } from 'react-error-boundary'
35import { QueryErrorResetBoundary } from '@tanstack/react-query'
36β
37function App() {
38 return (
39 <QueryErrorResetBoundary>
40 {({ reset }) => (
41 <ErrorBoundary
42 onReset={reset}
43 fallbackRender={({ resetErrorBoundary }) => (
44 <div>
45 There was an error!
46 <button onClick={() => resetErrorBoundary()}>Try again</button>
47 </div>
48 )}
49 >
50 <Page />
51 </ErrorBoundary>
52 )}
53 </QueryErrorResetBoundary>
54 )
55}
56```