From 9c2ab4262ed905e377775c08575eb64168578238 Mon Sep 17 00:00:00 2001 From: Andrei L <1881266+unrevised6419@users.noreply.github.com> Date: Wed, 12 Aug 2026 16:54:40 +0300 Subject: [PATCH] Add @types/react as an optional peer dependency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The published type declarations import 12 type-only symbols from "react", but the react package ships no types of its own, so consumers must resolve @types/react through ambient node_modules layout that this package neither declares nor controls. Under pnpm's global virtual store the package lives outside the consumer's project, the upward walk never reaches their @types/react, and "react" resolves to the untyped index.js — producing TS2607 and TS2786 on every use of ErrorBoundary. Declaring the peer makes the dependency explicit. It is optional so JavaScript-only consumers are unaffected, and the range mirrors the existing react peer range so both stay consistent. Co-Authored-By: Claude Opus 5 (1M context) --- package.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/package.json b/package.json index 7a8bb1d..5311c27 100644 --- a/package.json +++ b/package.json @@ -58,8 +58,14 @@ "**/*": "prettier --write --ignore-unknown" }, "peerDependencies": { + "@types/react": "^18.0.0 || ^19.0.0", "react": "^18.0.0 || ^19.0.0" }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + }, "devDependencies": { "@csstools/postcss-oklab-function": "^4.0.11", "@eslint/js": "^9.30.1",