fix(ui-components): react in regular dependencies causes duplicate hook errors in consumer apps
维护者通常 3 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 85/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- react, typescript
- 领域
- build-system, frontend
调研方向
从 packages/ui-components/package.json 开始,检查其中的 dependencies、peerDependencies 和 devDependencies。按描述移动 React,使用范围为 ^19.0.0 的命名 catalog 条目,并验证已发布的 package 能接受由 consumer 安装的 React 19,而不会创建重复副本。
由索引模型根据 Issue 内容生成。
描述
Description
Currently, react is listed under dependencies in packages/ui-components/package.json.
While it works fine inside the monorepo, it breaks consumer apps that use a different sub-version of React 19. Package managers install a duplicate copy of React , leading to the runtime error:
Invalid hook call. You might have more than one copy of React in the same app.
Proposed Solution
Move react from dependencies to peerDependencies (and duplicate in devDependencies for local workspace builds).
We should use a named pnpm catalog (catalog:peer-react19 with a ^19.0.0 range) so the published package accepts any React 19 version installed by the consumer app.
- 主要语言
- TypeScript
- 星标
- 6.9k
- 派生
- 6.5k
- 平均合并
- 2 天 16 小时
- 30 天内合并 PR
- 29
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
nodejs/nodejs.org 的其他 Issue
-
web-agenda
难度 2/5 1-3 小时 新手友好度 68/100
nodejs/nodejs.org#9098 · 3 条评论 · 1 个 reaction ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 86/100
nodejs/nodejs.org#8828 · 4 条评论 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 55/100
nodejs/nodejs.org#9166 · 3 条评论 · 1 个 reaction ·
维护者通常 3 天内回复
-
难度 3/5 1-2 天 新手友好度 68/100
nodejs/nodejs.org#9140 · 10 条评论 · 3 个 reaction ·
维护者通常 3 天内回复
-
难度 3/5 1-2 天 新手友好度 58/100
nodejs/nodejs.org#9099 · 3 条评论 · 1 个 reaction ·
维护者通常 3 天内回复
查看 nodejs/nodejs.org 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
rohitg00/agentmemory#1428 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 86/100
boxlite-ai/boxlite#1729 ·
维护者通常 1 天内回复
-
detectors enhancement good first issue
难度 2/5 1-3 小时 新手友好度 86/100
SM260845/readme-gen#1 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
angular/angularfire#3774 ·
维护者通常 2 天内回复