When using suspense or useErrorBoundaries in your queries, you need a way to let queries know that you want to try again when re-rendering after some error occurred. With the QueryErrorResetBoundary component you can reset any query errors within the boundaries of the component.

import { QueryErrorResetBoundary } from 'react-query'
import { ErrorBoundary } from 'react-error-boundary'
const App: React.FC = () => (
{({ reset }) => (
fallbackRender={({ resetErrorBoundary }) => (
There was an error!
<Button onClick={() => resetErrorBoundary()}>Try again</Button>
<Page />
Was this page helpful?


Subscribe to Bytes

The best JavaScript newsletter! Delivered every Monday to over 76,000 devs.


No spam. Unsubscribe at any time.

© 2020 Tanner Linsley. All rights reserved.