Skip to content

Tags: saonam/react-query

Tags

v2.4.0

Toggle v2.4.0's commit message
feat: add initialStale option to queries

By default `initialData` is not considered stale, but sometimes you may want it to be, for instance, if your initial data is only a partial subset of an object and you know you will need to refetch the full version immediately after mounting. For this, you can use the `initialStale: true` options.

By setting `initialStale` to `true`, the `initialData` will be considered `stale` and will cause a refetch when the query mounts for the first time.

```js
function Todos() {
  const queryInfo = useQuery('todos', () => fetch('/todos'), {
    initialData: todoListPreview,
    initialStale: true,
  })
}
```

v2.3.0

Toggle v2.3.0's commit message

v2.2.3

Toggle v2.2.3's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
fix: prefetchQuery args check (TanStack#631)

v2.2.2

Toggle v2.2.2's commit message
fix(prefetchQuery): add prefetchQuery(key, options) overload

v2.2.1

Toggle v2.2.1's commit message
fix: queryKeySerializer now in the right spot of the config

v2.2.0

Toggle v2.2.0's commit message
feat: add default quernFn option

This feature allows you to set a default query function in the config and use it for your whole app, similar to how early SWR user's were just passing a url. Now you can do the same and just do `useQuery('/todos')` :)

v2.1.1

Toggle v2.1.1's commit message
fix: query.state.isFetching defaults to the loading status, despite l…

…ack of data

Fixes TanStack#624

v2.1.0

Toggle v2.1.0's commit message
feat: added queryCache.resetErrorBoundaries

Info can be found in the docs under the `Resetting Error Boundaries` section

v2.0.4

Toggle v2.0.4's commit message

v2.0.3

Toggle v2.0.3's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
fix: remove unused wasPrefetched