github TanStack/query v2.1.0

latest releases: v5.35.0, v5.34.2, v5.34.1...
3 years ago

2.1.0 (2020-06-24)

Bug Fixes

  • suspense boundaries now catch query errors accurately

Features

  • added queryCache.resetErrorBoundaries (4c741f7)

Whether you are using suspense or useErrorBoundaries in your queries, you will need to know how to use the queryCache.resetErrorBoundaries function to let queries know that you want them to try again when you render them again.

How you trigger this function is up to you, but the most common use case is to do it in something like react-error-boundary's onReset callback:

import { queryCache } from "react-query";
import { ErrorBoundary } from "react-error-boundary";

<ErrorBoundary
  onReset={() => queryCache.resetErrorBoundaries()}
  fallbackRender={({ error, resetErrorBoundary }) => (
    <div>
      There was an error!
      <Button onClick={() => resetErrorBoundary()}>Try again</Button>
    </div>
  )}
>

Don't miss a new query release

NewReleases is sending notifications on new releases.