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

Review Change Stack

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 95e545b6-6f1c-4f4d-a589-28431aa0d048

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
📝 Walkthrough

Walkthrough

The @types/react devDependency is bumped from ~19.1.0 to ~19.2.0 uniformly across all 17 React example package.json files. No other dependencies, scripts, or manifest fields are changed.

Changes

@types/react version bump across React examples

Layer / File(s) Summary
@types/react ~19.1.0 → ~19.2.0
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
@types/react devDependency updated from ~19.1.0 to ~19.2.0 in all 17 React example manifests to satisfy the peer dependency required by @types/react-dom@19.2.x.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐇 A hop, a skip, a version bump so neat,
~19.2.0 makes the peer deps complete!
Seventeen package.json files all aligned,
No more ERESOLVE errors to grind.
The rabbit tidied up with one clean sweep! 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description provides comprehensive context, but does not follow the repository's required template structure with the specified sections and checklist items. Add the required template sections including the '## 🎯 Changes' section, '✅ Checklist' with the specified items, and '🚀 Release Impact' section.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: bumping @types/react to ~19.2.0 across all React examples.
Linked Issues check ✅ Passed The PR fully addresses issue #2216 by bumping @types/react to ~19.2.0 across all 17 React examples, resolving the ERESOLVE peer-dependency conflict.
Out of Scope Changes check ✅ Passed All changes are in-scope: only @types/react versions were updated across React example package.json files to resolve the documented dependency conflict.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@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

Tip

For best results, initiate chat on the files or code changes.

@tsushanth: Thanks for the update! The regenerated pnpm-lock.yaml looks good — all 17 example slots are now consistently pinned to ~19.2.0, and the residual ~19.1.0 entries in packages/react-form* are correctly scoped outside this PR. The fix is clean and minimal. 🐇 ✨


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

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