You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
v5.85.2 introduced a breaking change while using StrictMode impacting state of isLoading and isFetching
On initial load state of isLoading doesn't reflect described API behaviour, API states that isLoading reflects the state of the first fetch, not subsequent fetches. However with StrictMode enabled isLoading reverts to false before the first request finishes
Example above updates DOM as request state changes: req1: isLoading:false, state: success, fetching: false data: request 1, time=1755607826585. time= is added when request is finished
On initial load observe that isLoading: true, state: pending and fetching: false
Observe isLoading quickly changes to false but state remains pending.
Before v5.85.2isLoading would remain true until first request completes. If StrictMode is removed isLoading behaves as expected
Downgrade to 5.85.0 npm install @tanstack/react-query-devtools@5.85.0 @tanstack/react-query@5.85.0 and run the example again npm run dev and observe isLoading behaves as expected.
Expected behavior
At first load isLoading and isFetching should reflect the status of the first request.
Describe the bug
v5.85.2 introduced a breaking change while using
StrictModeimpacting state ofisLoadingandisFetchingOn initial load state of
isLoadingdoesn't reflect described API behaviour, API states thatisLoadingreflects the state of the first fetch, not subsequent fetches. However withStrictModeenabledisLoadingreverts tofalsebefore the first request finishesExample: https://stackblitz.com/edit/tanstack-query-2c4dbawu?file=src%2Findex.tsx
Example above updates DOM as request state changes:
req1: isLoading:false, state: success, fetching: false data: request 1, time=1755607826585.time=is added when request is finishedYour minimal, reproducible example
https://stackblitz.com/edit/tanstack-query-2c4dbawu?file=src%2Findex.tsx
Steps to reproduce
isLoading: true,state: pendingandfetching: falseisLoadingquickly changes tofalsebutstateremainspending.Before
v5.85.2isLoadingwould remain true until first request completes. IfStrictModeis removedisLoadingbehaves as expectedDowngrade to 5.85.0
npm install @tanstack/react-query-devtools@5.85.0 @tanstack/react-query@5.85.0and run the example againnpm run devand observeisLoadingbehaves as expected.Expected behavior
At first load
isLoadingandisFetchingshould reflect thestatusof the first request.How often does this bug happen?
Every time
Screenshots or Videos
Screen.Recording.2025-08-19.at.15.32.13.mov
Platform
Tanstack Query adapter
None
TanStack Query version
5.85.2
TypeScript version
No response
Additional context
No response