Repository navigation
Tags: mwmcode/react-query
Tags
fix(types): v2 (TanStack#626) * enable types, update simpleQuery * update MutationState * stricter query type Co-authored-by: Michaël De Boey <info@michaeldeboey.be> * verify imports * verify import 2 * update fetchMore * move ready condition to enabled * update MutateOptions * update config * fix QueryResulltBase * remove queryKey function * remove duplicate type * update prefetch * functions are not valid queryKeys * add option to queryFn, formatting * Add dtslinting to ci test * remove deprecated variables * add types to formatting * add resetErrorBoundaries Co-authored-by: Michaël De Boey <info@michaeldeboey.be>
fix(invalidateQueries): respect enabled flag Fixes TanStack#648
fix(query-cache): Prevent re-run of query for refetch interval if upd… …ate is disabled (TanStack#640) * fix(query-cache): Prevent re-run of query based on refetch interval if update is disabled * Update src/core/queryCache.js Co-authored-by: Bishwendu Kundu <bishwendu.kundu@broadcom.com> Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com> Fixes TanStack#635
fix(useMutation): ensure all side-effects are always called Fixes TanStack#249 Now all we need is the new test from TanStack#641
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,
})
}
```
Merge branch 'master' of https://github.com/tannerlinsley/react-query
PreviousNext