chore(examples): bump @types/react to ~19.2.0 in React examples by tsushanth · Pull Request #2220 · TanStack/form · GitHub
Skip to content

chore(examples): bump @types/react to ~19.2.0 in React examples#2220

Open
tsushanth wants to merge 2 commits into
TanStack:mainfrom
tsushanth:fix/example-react-types-19.2
Open

chore(examples): bump @types/react to ~19.2.0 in React examples#2220
tsushanth wants to merge 2 commits into
TanStack:mainfrom
tsushanth:fix/example-react-types-19.2

Conversation

@tsushanth

@tsushanth tsushanth commented Jun 21, 2026

Copy link
Copy Markdown

Closes #2216.

Why

npm install fails in every React example with an ERESOLVE peer-dependency conflict. The reporter @michaelboyles filed it against react/standard-schema but the same constraint exists across all 17 React examples:

  • Each example pins @types/react: ~19.1.0.
  • Each example also depends on @types/react-dom: ^19.0.3, which resolves to the latest 19.2.x (currently @types/react-dom@19.2.3).
  • @types/react-dom@19.2.3's peer is @types/react: ^19.2.0 (verified with npm view @types/react-dom@19.2.3 peerDependencies).

So the pinned ~19.1.0 (which only matches 19.1.x) can never satisfy the ^19.2.0 peer, and npm install bails out. npm install --legacy-peer-deps is the documented workaround but breaks pnpm install cleanness too.

What

Bumps @types/react from ~19.1.0 to ~19.2.0 across all 17 React examples. Runtime react / react-dom stay at 19.1.0 — types are forward-compatible within the same major, so this is the minimal change that resolves the peer constraint without changing the demonstrated React version.

@tanstack/react-devtools@latest's own peer is just @types/react: >=16.8, so it's not the source of the conflict and doesn't need touching.

Test plan

  • cd examples/react/standard-schema && npm install — succeeds (verified locally; was the reporter's exact repro).
  • Same fix applied to the other 16 examples for consistency since they have the identical version pin.

Note

Found and analyzed during a sweep of the fresh issue queue. Single mechanical change so I just shipped the fix — happy to scope back to only standard-schema if you'd rather take the 16 others as a separate PR.

Summary by CodeRabbit

  • Chores
    • Updated React type definitions to the latest minor version across all React example projects, ensuring compatibility with the latest type definitions.

`npm install` failed for the React examples (originally reported against
react/standard-schema in TanStack#2216) because each example pinned
`@types/react: ~19.1.0` while `@types/react-dom: ^19.0.3` resolves to
19.2.x — and `@types/react-dom@19.2.x` peer-requires
`@types/react: ^19.2.0`. Same conflict in all 17 React examples.

Bumps every React example's `@types/react` to `~19.2.0` so the dev-only
type peer constraint is satisfied. `react`/`react-dom` themselves stay
at 19.1.0; the types are forward-compatible within the same major.

Closes TanStack#2216
@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@examples/react/array/package.json`:
- Line 19: The package.json file has been updated to constrain `@types/react` to
~19.2.0, but the pnpm-lock.yaml file has not been regenerated to reflect this
new constraint and still contains the old specifier and resolved versions. Run
pnpm install to regenerate the pnpm-lock.yaml file so that it properly reflects
the updated `@types/react` constraint and resolves to the correct version across
all 17 React examples.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 16aaef4f-3050-42d9-b0b9-e9785a7c2184

📥 Commits

Reviewing files that changed from the base of the PR and between 6a73479 and 4593258.

📒 Files selected for processing (17)
  • examples/react/array/package.json
  • examples/react/compiler/package.json
  • examples/react/composition/package.json
  • examples/react/devtools/package.json
  • examples/react/dynamic/package.json
  • examples/react/expo/package.json
  • examples/react/field-errors-from-form-validators/package.json
  • examples/react/large-form/package.json
  • examples/react/multi-step-wizard/package.json
  • examples/react/next-server-actions-zod/package.json
  • examples/react/next-server-actions/package.json
  • examples/react/query-integration/package.json
  • examples/react/remix/package.json
  • examples/react/simple/package.json
  • examples/react/standard-schema/package.json
  • examples/react/tanstack-start/package.json
  • examples/react/ui-libraries/package.json

"@tanstack/react-devtools": "^0.9.7",
"@tanstack/react-form-devtools": "^0.2.29",
"@types/react": "~19.1.0",
"@types/react": "~19.2.0",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Verify all 17 React examples have `@types/react` bumped to ~19.2.0

# Search all React example package.json files for `@types/react` constraint
echo "Checking `@types/react` version across all React examples..."
fd -t f 'package\.json' examples/react --exec rg -H '`@types/react`.*19\.' {} \;

# Count how many files have the new constraint
echo ""
echo "Files with ~19.2.0:"
fd -t f 'package\.json' examples/react --exec grep -l '`@types/react`.*~19\.2\.0' {} \; | wc -l

echo "Files with old ~19.1.0 (should be 0):"
fd -t f 'package\.json' examples/react --exec grep -l '`@types/react`.*~19\.1\.0' {} \; | wc -l

Repository: TanStack/form

Length of output: 2648


🏁 Script executed:

#!/bin/bash
# Check if pnpm-lock.yaml has been updated to reflect the new constraint

echo "Checking pnpm-lock.yaml for `@types/react` 19.2.x resolution..."
if [ -f "pnpm-lock.yaml" ]; then
  # Look for resolved versions of `@types/react` that match 19.2.x
  rg '`@types/react`@' pnpm-lock.yaml -A 2 | head -20
  
  echo ""
  echo "Count of 19.2.x resolutions:"
  rg -o '`@types/react`.*?19\.2\.\d+' pnpm-lock.yaml | sort | uniq -c
else
  echo "pnpm-lock.yaml not found"
fi

Repository: TanStack/form

Length of output: 1171


🏁 Script executed:

#!/bin/bash
# More detailed check: search for `@types/react` version lines in pnpm-lock.yaml

echo "Searching for `@types/react` version resolutions..."
rg -A 1 "^\s*'`@types/react`':" pnpm-lock.yaml | head -30

echo ""
echo "Count of `@types/react`@19.1.17 (old version still in lock):"
rg -c '`@types/react`@19\.1\.17' pnpm-lock.yaml

echo ""
echo "Count of `@types/react`@19.2 (new version in lock):"
rg -c '`@types/react`@19\.2' pnpm-lock.yaml

Repository: TanStack/form

Length of output: 742


Regenerate pnpm-lock.yaml — it has not been updated to reflect the new constraint.

The 17 React examples have been correctly updated to @types/react: ~19.2.0 in their package.json files, but the pnpm-lock.yaml file has not been regenerated. It still contains the old specifier (~19.1.0) and resolved version (@types/react@19.1.17, appearing 310 times). Without regenerating the lock file, installations will continue to resolve to 19.1.17 despite the package.json declaring 19.2.0. Run pnpm install to update pnpm-lock.yaml before this can merge.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/react/array/package.json` at line 19, The package.json file has been
updated to constrain `@types/react` to ~19.2.0, but the pnpm-lock.yaml file has
not been regenerated to reflect this new constraint and still contains the old
specifier and resolved versions. Run pnpm install to regenerate the
pnpm-lock.yaml file so that it properly reflects the updated `@types/react`
constraint and resolves to the correct version across all 17 React examples.

@tsushanth

Copy link
Copy Markdown
Author

Thanks @coderabbitai — regenerated pnpm-lock.yaml in a2ba154. All 17 React example slots now resolve against @types/react@~19.2.0; the 5 leftover ~19.1.0 specifiers are in the packages/react-form* packages themselves (outside this PR's scope).

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

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.

npm install fails for react/standard-schema example

1 participant