Repository navigation
Conversation
The React packages ship type declarations that import from `react` but did not declare `@types/react`. With install layouts where it is not resolvable from the package's real path (e.g. pnpm's global virtual store), React types silently became `any`. Fixes TanStack#2472 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 08903d9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 packages
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 |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Fixes #2472
🎯 Changes
The React packages ship type declarations that import from
react, but they don't declare@types/react. With install layouts where@types/reactcan't be resolved from the package's real path (for example pnpm's global virtual store,virtualStoreType: global), TypeScript resolves the untypedreact/index.js. Every React type in these declarations then silently becomesany, and consumers get errors likeTS7006in their own code.This adds
@types/reactas an optional peer dependency, using the same range as the existingreactpeer (^17.0.0 || ^18.0.0 || ^19.0.0), to:@tanstack/react-form@tanstack/react-form-devtools@tanstack/react-form-nextjs@tanstack/react-form-remix@tanstack/react-form-startBecause the peer is optional, JavaScript consumers are unaffected.
@tanstack/react-querydoes the same thing inpackages/react-query/package.json.pnpm-lock.yamldoes not change.✅ Checklist
pnpm test:pr, or these tests do not apply to this pull request.🚀 Release Impact
🤖 Generated with Claude Code
Summary by CodeRabbit