Skip to content

chore: pin react types to 18.x project-wide#3313

Open
deepshekhardas wants to merge 1 commit into
triggerdotdev:mainfrom
deepshekhardas:pr-3267
Open

chore: pin react types to 18.x project-wide#3313
deepshekhardas wants to merge 1 commit into
triggerdotdev:mainfrom
deepshekhardas:pr-3267

Conversation

@deepshekhardas
Copy link
Copy Markdown

@deepshekhardas deepshekhardas commented Apr 2, 2026

Pins @types/react\ and @types/react-dom\ to \18.x\ project-wide using pnpm overrides.

Changes

  • Added @types/react: 18.2.69\ and @types/react-dom: 18.2.7\ to \overrides\ in root \package.json\
  • Prevents TypeScript errors caused by mixed 18.x/19.x type definitions

Testing

  • Verified \package.json\ override syntax
  • Lockfile regenerated cleanly after override addition

Related

Fixes TypeScript compilation errors across the monorepo where some packages resolve to React 19 types.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 2, 2026

⚠️ No Changeset found

Latest commit: 3e2d444

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@deepshekhardas
Copy link
Copy Markdown
Author

This PR has been rebased onto latest main. Could you please review? 🙏

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 2, 2026

Review Change Stack

Walkthrough

This PR adds two entries to the pnpm.overrides section in package.json, pinning @types/react to version 18.2.69 and @types/react-dom to version 18.2.7. These overrides force consistent type definition versions across the monorepo workspace regardless of what versions nested dependencies may request.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description includes changes and testing sections, but is missing several required template sections including the issue reference, checklist, and screenshots placeholder. Add 'Closes #' at the top, include the complete checklist with checkbox items, and add the screenshots section to match the repository template.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore: pin react types to 18.x project-wide' clearly and specifically summarizes the main change: pinning React type definitions to version 18.x across the project.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ 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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

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 `@package.json`:
- Around line 93-94: The package.json pins for TypeScript React types are out of
date: update the versions for `@types/react` and `@types/react-dom` to the latest
18.x patch releases; specifically change `@types/react` from 18.2.69 to 18.3.30
and `@types/react-dom` from 18.2.7 to 18.3.7, then run your package manager
install (npm/yarn/pnpm) and rebuild to ensure type compatibility; confirm no
breaking type changes affect functions/components that rely on react/react-dom
type declarations.
🪄 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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: f9521b5e-c88a-44d5-950d-3f36a5314076

📥 Commits

Reviewing files that changed from the base of the PR and between 2dd9f37 and 3e2d444.

📒 Files selected for processing (1)
  • package.json
📜 Review details
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{js,jsx,ts,tsx,json,md,yml,yaml}

📄 CodeRabbit inference engine (AGENTS.md)

Code formatting must be enforced using Prettier before committing

Files:

  • package.json
package.json

📄 CodeRabbit inference engine (CLAUDE.md)

package.json: Edit package.json directly instead of using pnpm add when adding dependencies, then run pnpm i from the repo root. See .claude/rules/package-installation.md for the full process.
Pin Zod to the exact same version across the entire monorepo (currently 3.25.76). Never use a different version or range in any package. Mismatched Zod versions cause runtime type incompatibilities.

Files:

  • package.json

Comment thread package.json
Comment on lines +93 to +94
"@types/react": "18.2.69",
"@types/react-dom": "18.2.7",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check latest 18.x versions of React type packages

echo "=== `@types/react` latest 18.x version ==="
npm view `@types/react` versions --json | jq -r '.[]' | grep '^18\.' | tail -1

echo -e "\n=== `@types/react-dom` latest 18.x version ==="
npm view `@types/react-dom` versions --json | jq -r '.[]' | grep '^18\.' | tail -1

echo -e "\n=== Checking for security advisories ==="
gh api graphql -f query='
{
  securityVulnerabilities(first: 5, ecosystem: NPM, package: "`@types/react`") {
    nodes {
      advisory {
        summary
        severity
        publishedAt
      }
      vulnerableVersionRange
      firstPatchedVersion {
        identifier
      }
    }
  }
}'

Repository: triggerdotdev/trigger.dev

Length of output: 262


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== Checking security advisories for `@types/react-dom` ==="
gh api graphql -f query='
{
  securityVulnerabilities(first: 5, ecosystem: NPM, package: "`@types/react-dom`") {
    nodes {
      advisory { summary severity publishedAt }
      vulnerableVersionRange
      firstPatchedVersion { identifier }
    }
  }
}'

Repository: triggerdotdev/trigger.dev

Length of output: 176


Bump pinned React type packages to the latest 18.x patch versions

  • @types/react is pinned to 18.2.69, but the latest 18.x patch is 18.3.30.
  • @types/react-dom is pinned to 18.2.7, but the latest 18.x patch is 18.3.7.
  • No GitHub-reported security advisories were found for either package in the vulnerability lookup.
🤖 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 `@package.json` around lines 93 - 94, The package.json pins for TypeScript
React types are out of date: update the versions for `@types/react` and
`@types/react-dom` to the latest 18.x patch releases; specifically change
`@types/react` from 18.2.69 to 18.3.30 and `@types/react-dom` from 18.2.7 to 18.3.7,
then run your package manager install (npm/yarn/pnpm) and rebuild to ensure type
compatibility; confirm no breaking type changes affect functions/components that
rely on react/react-dom type declarations.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

View 2 additional findings in Devin Review.

Open in Devin Review

Comment thread package.json
Comment on lines +93 to +94
"@types/react": "18.2.69",
"@types/react-dom": "18.2.7",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚩 Override silently downgrades trigger-sdk from @types/react 19 to 18

packages/trigger-sdk/package.json declares @types/react: ^19.2.14 as a devDependency, but this override forces it to 18.2.69. This is a significant version downgrade (React 19 → 18 types). I verified that the only React usage in the SDK (packages/trigger-sdk/src/v3/chat-react.ts) uses basic hooks (useCallback, useEffect, useRef, useState) that are fully compatible with React 18 types. However, the explicit ^19.2.14 pin was presumably added intentionally — future code additions to chat-react.ts using React 19 features (e.g., useActionState, use(), or the new ref prop pattern) would silently fail to typecheck correctly since the override masks the package-level declaration. Consider updating the trigger-sdk's package.json devDependency to 18.2.69 to make the intent explicit rather than relying on a global override to silently downgrade it.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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