react / react/react-native

Wrong types in RCTDeviceEventEmitter

Đang mở
#37,358 6 bình luận 0 reaction 0 người được giao Xem trên GitHub

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

Needs: Triage :mag: Never gets stale Newer Patch Available
Ngôn ngữ chính
C++
Star
127k
Fork
25.3k
Merge trung bình
1 ngày 23 giờ
Pull request đã merge (30 ngày)
4

Mô tả

Description

On a recent update of React Native we noticed that the export of RCTDeviceEventEmitter types is wrong.

After the update, the export in .d.ts has been changed to export const:

https://github.com/facebook/react-native/blob/cbc28da666c2d103242ad36caad577c69ecc430b/packages/react-native/Libraries/EventEmitter/RCTDeviceEventEmitter.d.ts#L28-L29

But in the .js file, the export still with export default:

https://github.com/facebook/react-native/blob/cbc28da666c2d103242ad36caad577c69ecc430b/packages/react-native/Libraries/EventEmitter/RCTDeviceEventEmitter.js#L31-L32

React Native Version

0.71.8

Output of npx react-native info

System:
OS: macOS 13.2.1
CPU: (8) arm64 Apple M1
Memory: 102.47 MB / 8.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.16.0 - ~/.nvm/versions/node/v16.16.0/bin/node
Yarn: 3.3.1 - ~/.nvm/versions/node/v16.16.0/bin/yarn
npm: 8.11.0 - ~/.nvm/versions/node/v16.16.0/bin/npm
Watchman: 2023.04.24.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.12.0 - /Users/douglas.junior/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
Android SDK:
API Levels: 30, 31, 33, 33
Build Tools: 30.0.2, 30.0.3, 31.0.0, 33.0.0, 34.0.0
System Images: android-32 | Google APIs ARM 64 v8a, android-32 | Google Play ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2022.1 AI-221.6008.13.2211.9477386
Xcode: 14.2/14C18 - /usr/bin/xcodebuild
Languages:
Java: 11.0.19 - /opt/homebrew/opt/openjdk@11/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.2.0 => 18.2.0
react-native: 0.71.7 => 0.71.7
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

N/A

Snack, code example, screenshot, or link to a repository

N/A

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

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.

Hướng nghiên cứu

Bắt đầu bằng cách so sánh packages/react-native/Libraries/EventEmitter/RCTDeviceEventEmitter.d.ts với tệp .js tương ứng tại các dòng được tham chiếu. Xác minh cách RCTDeviceEventEmitter được import và định kiểu, sau đó xác nhận rằng khai báo khớp với export khi runtime và không tạo ra lỗi kiểu đã được báo cáo.

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

Đánh giá

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

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.