Skip to content

v5.85.2 introduced a breaking change while using StrictMode #9579

@pvs-chainalysis

Description

@pvs-chainalysis

Describe the bug

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: 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 finished

Your minimal, reproducible example

https://stackblitz.com/edit/tanstack-query-2c4dbawu?file=src%2Findex.tsx

Steps to reproduce

  1. On initial load observe that isLoading: true, state: pending and fetching: false
  2. Observe isLoading quickly changes to false but state remains pending.

Before v5.85.2 isLoading would remain true until first request completes. If StrictMode is removed isLoading behaves as expected

Downgrade to 5.85.0 npm install @tanstack/[email protected] @tanstack/[email protected] 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.

How often does this bug happen?

Every time

Screenshots or Videos

Screen.Recording.2025-08-19.at.15.32.13.mov

Platform

  • OS: macOS
  • Browser: Chrome
  • Version: 5.85.2

Tanstack Query adapter

None

TanStack Query version

5.85.2

TypeScript version

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions