Skip to content

fix(react-query*): declare '@types/react' as a peer dependency like 'react-query-devtools' - #11728

Open
sukvvon wants to merge 2 commits into
mainfrom
fix/react-query-types-react-peer
Open

sukvvon wants to merge 2 commits into
mainfrom
fix/react-query-types-react-peer

Conversation

@sukvvon

@sukvvon sukvvon commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

🎯 Changes

  • Add "@types/react": "^18 || ^19" to the peerDependencies of react-query, react-query-next-experimental, and react-query-persist-client. Their published type declarations import React types, and react-query-devtools already declares the same peer dependency so they resolve with strict package managers.
  • Remove the '@types/react!' knip ignores and their comment for these packages, since the peer declaration now satisfies the strict check.
  • Add a patch changeset for the three packages.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested code changes locally with pnpm run test:pr, or these tests do not apply to this pull request.
  • I have followed the AI contribution policy and fully understand the code in this pull request, including any code generated with AI assistance.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Compatibility
    • React Query, React Query Next Experimental, and React Query Persist Client now declare support for React type definitions version 18 and 19, improving compatibility when installing these packages in TypeScript projects.
  • Release Updates
    • Patch releases are planned for all three packages to include this compatibility update.

@sukvvon sukvvon self-assigned this Sep 29, 2026
@nx-cloud

nx-cloud Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit c480694

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 4m 26s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 6s View ↗

☁️ Nx Cloud last updated this comment at 2026-10-04 19:16:33 UTC

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

4 package(s) bumped directly, 21 bumped as dependents.

🟩 Patch bumps

Package Version Reason
@tanstack/query-core 5.104.1 → 5.104.2 Changeset
@tanstack/react-query 5.104.1 → 5.104.2 Changeset
@tanstack/react-query-next-experimental 5.104.1 → 5.104.2 Changeset
@tanstack/react-query-persist-client 5.104.1 → 5.104.2 Changeset
@tanstack/angular-query-experimental 5.104.1 → 5.104.2 Dependent
@tanstack/angular-query-persist-client 5.104.1 → 5.104.2 Dependent
@tanstack/eslint-plugin-query 5.104.1 → 5.104.2 Dependent
@tanstack/lit-query 0.2.26 → 0.2.27 Dependent
@tanstack/preact-query 5.104.1 → 5.104.2 Dependent
@tanstack/preact-query-devtools 5.104.1 → 5.104.2 Dependent
@tanstack/preact-query-persist-client 5.104.1 → 5.104.2 Dependent
@tanstack/query-async-storage-persister 5.104.1 → 5.104.2 Dependent
@tanstack/query-broadcast-client-experimental 5.104.1 → 5.104.2 Dependent
@tanstack/query-devtools 5.104.1 → 5.104.2 Dependent
@tanstack/query-persist-client-core 5.104.1 → 5.104.2 Dependent
@tanstack/query-sync-storage-persister 5.104.1 → 5.104.2 Dependent
@tanstack/react-query-devtools 5.104.1 → 5.104.2 Dependent
@tanstack/solid-query 5.104.1 → 5.104.2 Dependent
@tanstack/solid-query-devtools 5.104.1 → 5.104.2 Dependent
@tanstack/solid-query-persist-client 5.104.1 → 5.104.2 Dependent
@tanstack/svelte-query 6.3.1 → 6.3.2 Dependent
@tanstack/svelte-query-devtools 6.3.1 → 6.3.2 Dependent
@tanstack/svelte-query-persist-client 6.3.1 → 6.3.2 Dependent
@tanstack/vue-query 5.104.1 → 5.104.2 Dependent
@tanstack/vue-query-devtools 6.3.1 → 6.3.2 Dependent

@pkg-pr-new

pkg-pr-new Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-experimental@11728

@tanstack/eslint-plugin-query

npm i https://pkg.pr.new/@tanstack/eslint-plugin-query@11728

@tanstack/lit-query

npm i https://pkg.pr.new/@tanstack/lit-query@11728

@tanstack/preact-query

npm i https://pkg.pr.new/@tanstack/preact-query@11728

@tanstack/preact-query-devtools

npm i https://pkg.pr.new/@tanstack/preact-query-devtools@11728

@tanstack/preact-query-persist-client

npm i https://pkg.pr.new/@tanstack/preact-query-persist-client@11728

@tanstack/query-async-storage-persister

npm i https://pkg.pr.new/@tanstack/query-async-storage-persister@11728

@tanstack/query-broadcast-client-experimental

npm i https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@11728

@tanstack/query-core

npm i https://pkg.pr.new/@tanstack/query-core@11728

@tanstack/query-devtools

npm i https://pkg.pr.new/@tanstack/query-devtools@11728

@tanstack/query-persist-client-core

npm i https://pkg.pr.new/@tanstack/query-persist-client-core@11728

@tanstack/query-sync-storage-persister

npm i https://pkg.pr.new/@tanstack/query-sync-storage-persister@11728

@tanstack/react-query

npm i https://pkg.pr.new/@tanstack/react-query@11728

@tanstack/react-query-devtools

npm i https://pkg.pr.new/@tanstack/react-query-devtools@11728

@tanstack/react-query-next-experimental

npm i https://pkg.pr.new/@tanstack/react-query-next-experimental@11728

@tanstack/react-query-persist-client

npm i https://pkg.pr.new/@tanstack/react-query-persist-client@11728

@tanstack/solid-query

npm i https://pkg.pr.new/@tanstack/solid-query@11728

@tanstack/solid-query-devtools

npm i https://pkg.pr.new/@tanstack/solid-query-devtools@11728

@tanstack/solid-query-persist-client

npm i https://pkg.pr.new/@tanstack/solid-query-persist-client@11728

@tanstack/svelte-query

npm i https://pkg.pr.new/@tanstack/svelte-query@11728

@tanstack/svelte-query-devtools

npm i https://pkg.pr.new/@tanstack/svelte-query-devtools@11728

@tanstack/svelte-query-persist-client

npm i https://pkg.pr.new/@tanstack/svelte-query-persist-client@11728

@tanstack/vue-query

npm i https://pkg.pr.new/@tanstack/vue-query@11728

@tanstack/vue-query-devtools

npm i https://pkg.pr.new/@tanstack/vue-query-devtools@11728

commit: c480694

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Repository: TanStack/query/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ae1886f0-b5ab-4769-b0c6-b6c29a086211
📥 Commits

Reviewing files that changed from the base of the PR and between c28b3bc and c480694.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: TanStack/query/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 3bcebb10-2e3c-4151-9b2c-f9cd237ff0fc

📥 Commits

Reviewing files that changed from the base of the PR and between 1e4be4e and c28b3bc.

📒 Files selected for processing (5)
  • .changeset/react-query-types-react-peer.md
  • knip.ts
  • packages/react-query-next-experimental/package.json
  • packages/react-query-persist-client/package.json
  • packages/react-query/package.json
💤 Files with no reviewable changes (1)
  • knip.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The three React Query packages add @types/react as a peer dependency supporting React 18 and 19. Knip no longer ignores this dependency for those packages. A Changeset records patch releases.

Changes

React type peer dependencies

Layer / File(s) Summary
Declare React type peer dependencies
packages/react-query/package.json, packages/react-query-next-experimental/package.json, packages/react-query-persist-client/package.json, knip.ts, .changeset/react-query-types-react-peer.md
The three package manifests add @types/react as a peer dependency for React 18 and 19. Knip ignore entries are removed. The Changeset records patch releases for the three packages.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: lachlancollins

Merge Risk: ⚪ Minimal · up to c28b3

The dependency ranges and release entries match the affected packages. No material issue remains to address before merging.

Architecture Summary

Architecture risk: 🔵 Low · up to c28b3

The change affects 4 systems.

Changed systems: knip.ts, packages/react-query, packages/react-query-next-experimental, packages/react-query-persist-client

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — knip.ts (service) was modified; 1 changed file maps to changed impact.
  • observed — packages/react-query (library) was modified; 1 changed file maps to changed impact.
  • observed — packages/react-query-next-experimental (library) was modified; 1 changed file maps to changed impact.
  • observed — packages/react-query-persist-client (library) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in knip.ts: The comment and workspace configuration entries for packages/react-query, packages/react-query-next-experimental, and packages/react-query-persist-client were removed, including each @types/react! dependency-ignore setting.
  • observed — Modified behavior in packages/react-query-next-experimental/package.json: Adds @types/react as a peer dependency, accepting versions ^18 or ^19.
  • observed — Modified behavior in packages/react-query-persist-client/package.json: Adds @types/react as a peer dependency, accepting versions 18 or 19.
  • observed — Modified behavior in packages/react-query/package.json: Adds @types/react as a peer dependency supporting versions 18 and 19.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: declaring @types/react as a peer dependency for the React Query packages.
Description check ✅ Passed The description includes the required Changes, Checklist, and Release Impact sections. It explains the motivation, lists the affected packages, confirms testing and policy compliance, and documents th…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react full 11.73 KB (0%)
react minimal 8.58 KB (0%)

@changeset-bot

changeset-bot Bot commented Oct 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c480694

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 24 packages
Name Type
@tanstack/react-query Patch
@tanstack/react-query-next-experimental Patch
@tanstack/react-query-persist-client Patch
@tanstack/react-query-devtools Patch
@tanstack/angular-query-experimental Patch
@tanstack/eslint-plugin-query Patch
@tanstack/preact-query-devtools Patch
@tanstack/preact-query-persist-client Patch
@tanstack/preact-query Patch
@tanstack/query-async-storage-persister Patch
@tanstack/query-broadcast-client-experimental Patch
@tanstack/query-core Patch
@tanstack/query-devtools Patch
@tanstack/query-persist-client-core Patch
@tanstack/query-sync-storage-persister Patch
@tanstack/solid-query-devtools Patch
@tanstack/solid-query-persist-client Patch
@tanstack/solid-query Patch
@tanstack/vue-query Patch
@tanstack/lit-query Patch
@tanstack/svelte-query Patch
@tanstack/svelte-query-devtools Patch
@tanstack/vue-query-devtools Patch
@tanstack/svelte-query-persist-client Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant