Bug Report: `children` type missing when using components import with Strict ABI
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ó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- react-native, typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Start with the react-native-css/components entry point, where View is re-exported with a className prop, and check how its props type is built from React Native's ViewProps. Reproduce by enabling Strict ABI in a small Expo app and running tsc on the ExpoView usage in app/index.tsx. Done when children type-checks on the wrapped component without TS2322, and the fix is clear about whether it belongs in the library's types or in the Strict ABI type setup.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Repository: my-expo-app
Describe the bug
When using React Native Strict/Standard ABI together with react-native-css, importing components from:
import { View as ExpoView } from 'react-native-css/components';
results in a TypeScript error because children is not included in the type definition.
Additionally, Strict ABI updates the types of all React Native components in the project itself, but it does not update the types inside the react-native-css library, which creates a mismatch between project components and library components.
Error message
app/index.tsx:12:6 - error TS2322: Type '{ children: Element; style: { flex: number; alignItems: "center"; padding: number; }; className: string; }' is not assignable to type 'IntrinsicAttributes & ViewProps & { className?: string | undefined; }'.
Property 'children' does not exist on type 'IntrinsicAttributes & ViewProps & { className?: string | undefined; }'.
12 <ExpoView style={styles.container} className="bg-red-200">
~~~~~~~~
Reproduction
-
Repo: [my-expo-app](https://github.com/salemkode/my-expo-app.git)
-
Steps:
- Clone repo
- Install deps
- Enable Strict ABI
- Run and observe the TypeScript error on
ExpoView
Expected behavior
ExpoView (and other components from react-native-css/components) should behave like normal React Native components extended with { className?: string }, meaning they should support children out of the box.
Actual behavior
- Types are missing
children. - Project components get updated types from Strict ABI, but the library components keep outdated types, leading to incompatibility.
Additional context
- The issue happens only with Strict/Standard ABI enabled.
- Without Strict ABI, the app compiles successfully.
- Using
styled(RNView)directly works fine. - Not sure if the fundamental fix should come from
react-native-cssdirectly or through additional adjustments in Strict ABI support.
- Ngôn ngữ chính
- TypeScript
- Star
- 166
- Fork
- 45
- Merge trung bình
- 13 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của nativewind/react-native-css
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
nativewind/react-native-css#545 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
nativewind/react-native-css#544 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
nativewind/react-native-css#543 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
nativewind/react-native-css#540 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
nativewind/react-native-css#538 ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của nativewind/react-native-css
Issue tương tự
-
fix(worker): keep normal prepare waiting states failure-freeCó thể đã có người làm @LichKing-2234 đã nhận hôm nay. Đang mởagent:codex priority:P1
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
AgoraIO-Extensions/agent-infra#3745 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
The five-line work window can drop its oldest line: the per-line byte share ignores the JSON framingCó thể đã có người làm @Eapp1e đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
makecindy/cindy#7973 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
lingdojo/kana-dojo#33337 · 1 bình luận · 5 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
coder/xum#7733 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
code-yeongyu/senpi#4917 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày