unstale

npm / @tanstack/react-query

@tanstack/react-query

What changed in @tanstack/react-query 4 to 5, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-17.

6 breaking3 new APIs and options4 behavior and defaults1 tooling15 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.1.1 on npm

@tanstack/react-query 525 changes

Breaking changes 6

  • The unused experimental_afterQuery hook has been removed.

    5.102.0release notes

  • The unused experimental_beforeQuery hook has been removed.

    5.102.0release notes

  • The promise property has been removed from query results.

    5.102.0release notes

  • Experimental render-time prefetching has been removed.

    5.102.0release notes

  • placeholderData has been removed from suspense infinite queries.

    5.102.0release notes

  • Adds environmentManager.

    5.91.0release notes

Behavior and default changes 4

  • TData now defaults to InfiniteData<TQueryFnData> to match hook generics.

    5.102.0release notes

  • usePrefetchInfiniteQuery now uses queryClient.infiniteQuery for prefetching.

    5.102.0release notes

  • usePrefetchQuery now uses queryClient.query for prefetching.

    5.102.0release notes

  • TData now defaults to InfiniteData<TQueryFnData> to match hook generics.

    5.102.0release notes

Tooling 1

  • Codemods no longer copy unnecessary files from the codemods project.

    5.103.3release notes

Fixes and other changes 14

  • useQueries and useSuspenseQueries now throw falsy errors to the error boundary.

    5.102.6release notes

  • Return types can be emitted in declaration files without leaking internal data tag symbols.

    5.102.0release notes

  • Return types can be emitted in declaration files without leaking internal data tag symbols.

    5.102.0release notes

  • Type-only exports no longer emit a runtime import.

    5.102.0release notes

  • Mutation variables become optional when undefined extends TVariables.

    5.102.0release notes

  • Generic type parameters now propagate to the useMutationState select callback.

    5.102.0release notes

  • Unsubscribed useQueries no longer show optimistic fetching.

    5.102.0release notes

  • useQuery return types retain NoInfer.

    5.102.0release notes

  • React Query no longer enters optimistic fetching state when the query is not subscribed.

    5.100.14release notes

  • Suspense queries now skip calling combine, preventing combine from running when queries would suspend.

    5.100.3release notes

  • Resolved an issue involving the excluded build directory.

    5.94.5release notes

  • Maintains error state on reset refetch when initialData is defined.

    5.91.2release notes

  • Allows retryOnMount when throwOnError is a function.

    5.90.16release notes

  • Prevents infinite render loops when useSuspenseQueries has duplicate queryKeys.

    5.90.11release notes

@tanstack/react-query 44 changes

New APIs and options 3

  • Adds mutationOptions to React Query v4 for configuring mutations.

    4.44.0release notes

  • Adds usePrefetchInfiniteQuery to react-query.

    4.43.0release notes

  • Adds usePrefetchQuery to react-query.

    4.43.0release notes

Fixes and other changes 1

  • Updated to support React 19 as a peer dependency correctly.

    4.42.2release notes