Describe the bug
When using the PersistQueryClient on first load, before the data has been hydrated, isFetching is false while isPending true. This may be expected behavior, but seems to contradict the docs which state: "fetching: Is true whenever the queryFn is executing, which includes initial pending as well as background refetches."
Your minimal, reproducible example
https://codesandbox.io/p/sandbox/elated-pasteur-9srm74
Steps to reproduce
In the CodeSandbox I have a dummy restoreClient which just awaits a long setTimeout, and single useQuery. I display the isPending and isFetching variables which are true and false respectively on first load.
Expected behavior
I expect isFetching to be true when isPending is true on first load.
How often does this bug happen?
None
Screenshots or Videos
No response
Platform
OS: [Windows]
Browser: [Chrome]
Tanstack Query adapter
react-query
TanStack Query version
5.62.3
TypeScript version
5.7.2
Additional context
No response
Describe the bug
When using the
PersistQueryClienton first load, before the data has been hydrated,isFetchingis false whileisPendingtrue. This may be expected behavior, but seems to contradict the docs which state: "fetching: Istruewhenever the queryFn is executing, which includes initialpendingas well as background refetches."Your minimal, reproducible example
https://codesandbox.io/p/sandbox/elated-pasteur-9srm74
Steps to reproduce
In the CodeSandbox I have a dummy
restoreClientwhich just awaits a longsetTimeout, and singleuseQuery. I display theisPendingandisFetchingvariables which aretrueandfalserespectively on first load.Expected behavior
I expect
isFetchingto betruewhenisPendingistrueon first load.How often does this bug happen?
None
Screenshots or Videos
No response
Platform
OS: [Windows]
Browser: [Chrome]
Tanstack Query adapter
react-query
TanStack Query version
5.62.3
TypeScript version
5.7.2
Additional context
No response