Skip to content

chore(react-query): update peer-deps for react19 in v4 #9310

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: v4
Choose a base branch
from

Conversation

gwansikk
Copy link
Contributor

@gwansikk gwansikk commented Jun 25, 2025

related: #8441

I'm the maintainer of Suspensive (a community project for React Query), who previously submitted a PR regarding React 19 support in React Query v4.

This time, I'd like to explicitly specify React 19 in the peerDependencies instead of the dependencies. React Query v4 is already compatible with React 19 without any code changes, and we've confirmed this through the following steps:

  • Built a custom tarball package(pnpm pack) with React 19 specified in peerDependencies
  • Linked the tarball in a React 19 environment for testing
  • Confirmed that it works without issues (we were able to resolve previously occurring warnings and errors)

There are no breaking changes in React 19 that affect compatibility, and v4 works reliably without special handling. If issues do arise, they would likely be due to changes in React 19, not React Query v4 itself.

Currently, since React 19 is not listed in peerDependencies, using react-query@v4 in a React 19 environment causes the following problems:

  • Peer dependency warnings are triggered by the package manager
  • Community libraries built on top of React Query v4 may face confusion when trying to support React 19

Copy link

nx-cloud bot commented Jun 25, 2025

View your CI Pipeline Execution ↗ for commit 5f2612f.

Command Status Duration Result
nx affected --targets=test:lib,test:types,test:... ✅ Succeeded 3h 2m 48s View ↗

☁️ Nx Cloud last updated this comment at 2025-06-28 13:26:50 UTC

Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 5f2612f:

Sandbox Source
@tanstack/query-example-react-basic-typescript Configuration
@tanstack/query-example-solid-basic-typescript Configuration
@tanstack/query-example-svelte-basic Configuration
@tanstack/query-example-vue-basic Configuration

@gwansikk
Copy link
Contributor Author

I can't reproduce the issue in the local test environment. Is there a problem with the CI pipeline?

@gwansikk gwansikk marked this pull request as ready for review June 28, 2025 05:16
Copy link
Collaborator

@manudeli manudeli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m in favor of adding React 19 to the peerDependencies of @tanstack/react-query v4.
Since it seems that @TkDodo previously opposed this change, I wanted to tag you and check if you’re okay with it before merging.

From what I understand, there’s nothing in @tanstack/react-query v4 that should cause issues with React 19.
If there are any problems, I’d expect them to be due to changes in React itself — so I think it should be safe to go ahead with the merge. Would that be alright with you?

@manudeli manudeli requested a review from TkDodo June 28, 2025 15:29
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.

2 participants