Skip to content

fix: add optional @types/react peerDependency for pnpm#4077

Open
Hashim1999164 wants to merge 1 commit into
jaredpalmer:mainfrom
Hashim1999164:fix/4063-types-react-peer-dep
Open

fix: add optional @types/react peerDependency for pnpm#4077
Hashim1999164 wants to merge 1 commit into
jaredpalmer:mainfrom
Hashim1999164:fix/4063-types-react-peer-dep

Conversation

@Hashim1999164

@Hashim1999164 Hashim1999164 commented Jul 23, 2026

Copy link
Copy Markdown

Summary

  • Adds @types/react as an optional peer dependency so Formik's shipped .d.ts files resolve under strict pnpm (hoist: false).
  • Marks it optional via peerDependenciesMeta so JS-only consumers are not warned.

Fixes #4063

Test plan

  • Confirm packages/formik/package.json lists @types/react under peerDependencies and peerDependenciesMeta.optional
  • In a pnpm project with hoist: false, installing formik + @types/react should typecheck without TS2307 for react
  • Existing npm/yarn installs should be unchanged

Declare @types/react as an optional peer so TypeScript can resolve
formik's React types under strict pnpm layouts without hoist. Fixes jaredpalmer#4063.
@vercel

vercel Bot commented Jul 23, 2026

Copy link
Copy Markdown

@Hashim1999164 is attempting to deploy a commit to the Formik Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 8b518a7

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

@codesandbox-ci

Copy link
Copy Markdown

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.

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.

formik fails with pnpm strict mode — missing peerDependency on @types/react

1 participant