From 24bdec6a241bf648460d62cc601a178ae220135c Mon Sep 17 00:00:00 2001 From: Andrei L <1881266+unrevised6419@users.noreply.github.com> Date: Thu, 24 Sep 2026 06:06:03 +0300 Subject: [PATCH] feat: add optional @types/react peer dependency The published declarations import `react` for its types, but only the `react` runtime peer is declared. Package managers that install the package outside the consumer's repository (pnpm's global virtual store) therefore leave no `@types/react` reachable from the shipped `.d.ts` files, and `React.*` resolves to the untyped `react/index.js` or to nothing at all. Declaring `@types/react` as an optional peer at `>= 18`, mirroring the `react` peer this package already declares, makes the types resolvable without affecting non-TypeScript consumers and without pinning a specific version. --- package.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/package.json b/package.json index 08d20b2..a74b3c5 100644 --- a/package.json +++ b/package.json @@ -91,9 +91,15 @@ "typescript": "^6.0.3" }, "peerDependencies": { + "@types/react": ">= 18", "react": ">= 18", "react-dom": ">= 18" }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + }, "pnpm": { "onlyBuiltDependencies": [ "@parcel/watcher",