Skip to content

fix(ui-components): move react from dependencies to peer and dev deps - #9176

Open
alexicum wants to merge 1 commit into
nodejs:mainfrom
alexicum:fix/ui-components-peer-react
Open

alexicum wants to merge 1 commit into
nodejs:mainfrom
alexicum:fix/ui-components-peer-react

Conversation

@alexicum

Copy link
Copy Markdown

Context

The ui-components package had react listed under dependencies. When published, this metadata structure forces consumer applications running a different sub-version of React 19 to install a duplicate instance of React, triggering runtime Invalid hook call errors.

Changes

To resolve external runtime duplication while preserving strict React 19 compatibility and seamless local workspace development, this PR applies the following:

  1. Moved react to peerDependencies in packages/ui-components/package.json using the catalog:peer-react19 protocol to delegate runtime React resolution to the host/consumer application.
  2. Duplicated react in devDependencies to guarantee that local package builds (pnpm build), test utilities, and TypeScript types compilation inside the isolated package directory do not break.
  3. Aligned pnpm Catalogs (pnpm-workspace.yaml): Configured catalog:peer-react19 to target a loose ^19.0.0 range. When the library is published, pnpm will substitute the catalog protocol with a standard open SemVer range (^19.0.0) matching any consumer's native React 19 installation.
  4. Added a Changeset: Generated a patch bump changeset (.changeset/cozy-teeth-speak.md) to comply with the workspace publishing policy.

Fixes #9175

…ndencies

Signed-off-by: Aleksey Shestakov <alshestakov25@gmail.com>
@alexicum
alexicum requested review from a team as code owners September 25, 2026 17:43
@vercel

vercel Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nodejs-org Ready Ready Preview Sep 25, 2026 5:44pm UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview — df650c28 Deployed Sep 25, 2026 by vercel[bot]
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.

fix(ui-components): react in regular dependencies causes duplicate hook errors in consumer apps

1 participant