Releases: TanStack/query
Releases · TanStack/query
v1.5.10
1.5.10 (2020-06-28)
Bug Fixes
- setQueryData: setQueryData(notInstantiatedQueryKey) now assigns Promise.resolve() instead of new Promise(noop) that caused a never ending promise en certain scenarios. Ref bug #639 (#645) (5546670)
v2.4.2
2.4.2 (2020-06-27)
Bug Fixes
- query-cache: Prevent re-run of query for refetch interval if update is disabled (#640) (db5a51e), closes #635
- disabling query in suspense mode (#643) (53e8424)
v2.4.1
2.4.1 (2020-06-27)
Bug Fixes
- useMutation: ensure all side-effects are always called (5a5ad74), closes #249 #641
v2.4.0
2.4.0 (2020-06-25)
Features
- add initialStale option to queries (d7048d1)
v2.2.3
2.2.3 (2020-06-25)
Bug Fixes
v2.2.2
2.2.2 (2020-06-25)
Bug Fixes
- prefetchQuery: add prefetchQuery(key, options) overload (0054f7f)
v2.2.1
2.2.1 (2020-06-24)
Bug Fixes
- queryKeySerializer now in the right spot of the config (a68dc28)
v2.2.0
2.2.0 (2020-06-24)
Bug Fixes
- call onSuccess for all query instances (c9afbc9)
- call onSuccess for all query instances on (a05cb50), closes #629
- don't schedule garbage collection unnecessarily (#627) (1e1e0f6)
Features
- add default quernFn option (2a31f8d)
v2.1.1
2.1.1 (2020-06-24)
Bug Fixes
- query.state.isFetching defaults to the loading status, despite lack of data (fd280ec), closes #624
v2.1.0
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>
)}
>