Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở Phù hợp với người mới
#9,175 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 3 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
85/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
react, typescript
Lĩnh vực
build-system, frontend

Hướng nghiên cứu

Bắt đầu với packages/ui-components/package.json và kiểm tra dependencies, peerDependencies và devDependencies của nó. Di chuyển React như mô tả, sử dụng mục catalog có tên với khoảng ^19.0.0, và xác minh rằng package đã phát hành chấp nhận React 19 do consumer cài đặt mà không tạo một bản sao trùng lặp.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
6.9k
Fork
6.5k
Merge trung bình
2 ngày 16 giờ
Pull request đã merge (30 ngày)
29

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của nodejs/nodejs.org

Tất cả issue của nodejs/nodejs.org

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.