types.d.ts doesn't type-check against React Native 0.88: Touchable, ScrollViewProps and VirtualizedListProps
維護者通常 12 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 72/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- react-native, typescript
- 領域
- mobile-dev
研究方向
從 types.d.ts(第 1-30 行)開始,其中 Touchable、ScrollViewProps 和 VirtualizedListProps 被 augmented。檢查 React Native 0.88 的類型以查看被移除的 exports/generics,然後修復 extends 子句。當在 repro repo 上執行 npx tsc 沒有報告來自 react-native-css/types.d.ts 的錯誤時完成。
由索引模型根據 Issue 內容生成。
描述
Before submitting a new issue
- I tested using the latest version of the library, as the bug might be already fixed.
- I tested using a supported version of react native.
- I checked for possible duplicate issues, with possible answers.
Bug summary
react-native-css/types (the reference nativewind-env.d.ts adds) augments react-native with names and extends clauses that React Native 0.88's generated types no longer have, so a project that checks declarations (skipLibCheck: false) gets errors from it (types.d.ts at 2421ea7):
Touchableis no longer exported byreact-native.interface ScrollViewProps extends ViewProps, ScrollViewPropsIOS, ScrollViewPropsAndroid, Touchableclashes with 0.88's ownScrollViewProps, and theclassNamethe file adds toViewPropsandImagePropsBasemakesScrollViewProps,ImageBackgroundPropsandKeyboardAvoidingViewPropsunable to extend both of their bases.VirtualizedListPropsis no longer generic, soFlatListProps<ItemT> extends VirtualizedListProps<ItemT>fails.
Library version
0.0.0-nightly.2421ea7 (main at 2421ea77da52), and 3.1.0-rc.0
Environment info
Windows 11 10.0.26300, Node 26.12.1, npm 12.2.1, TypeScript 7.0.2, react-native 0.88.1, react 19.3.1, @types/react 19.3.0.
No app or native build is involved: the errors come from the type check alone.
Steps to reproduce
- Clone the reproducible example: a
package.jsonwithreact-native0.88.1 andreact-native-css0.0.0-nightly.2421ea7, atsconfig.jsonwithstrictandskipLibCheck: false, and anindex.tsholding onlyimport type {} from 'react-native-css/types';. npm install --ignore-scriptsnpx tsc -p .
Expected: no error from react-native-css/types.d.ts.
Actual, among the output (the run also prints a few errors of React Native's own declarations, which are separate):
node_modules/react-native-css/types.d.ts(6,3): error TS2305: Module '"react-native"' has no exported member 'Touchable'.
node_modules/react-native-css/types.d.ts(22,13): error TS2320: Interface 'ScrollViewProps' cannot simultaneously extend types 'Readonly<Omit<Omit<ViewProps, "experimental_accessibilityOrder">, "StickyHeaderComponent" | "alwaysBounceHorizontal" | "alwaysBounceVertical" | "automaticallyAdjustContentInsets" | ... 62 more ... | "zoomScale"> & Omit<...> & Omit<...> & Omit<...>>' and 'ViewProps'.
node_modules/react-native-css/types.d.ts(29,42): error TS2315: Type 'VirtualizedListProps' is not generic.
node_modules/react-native/types_generated/Libraries/Components/Keyboard/KeyboardAvoidingView.d.ts(40,18): error TS2320: Interface 'KeyboardAvoidingViewProps' cannot simultaneously extend types ...
Named property 'className' of types ...
node_modules/react-native/types_generated/Libraries/Image/ImageProps.d.ts(291,18): error TS2320: Interface 'ImageBackgroundProps' cannot simultaneously extend types ...
Named property 'className' of types ...
Reproducible example repository
https://github.com/YevheniiKotyrlo/react-native-css-types-react-native-0-88
- 主要語言
- TypeScript
- 星號
- 166
- 分支
- 45
- 平均合併
- 17 天 22 小時
- 30 天內合併 PR
- 3
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
nativewind/react-native-css 的其他 Issue
-
難度 1/5 1 小時以內 新手友好度 88/100
nativewind/react-native-css#554 ·
維護者通常 12 天內回覆
-
難度 2/5 1-3 小時 新手友好度 70/100
nativewind/react-native-css#549 · 2 則留言 ·
維護者通常 12 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
nativewind/react-native-css#545 ·
維護者通常 12 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
nativewind/react-native-css#544 ·
維護者通常 12 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
nativewind/react-native-css#543 ·
維護者通常 12 天內回覆
查看 nativewind/react-native-css 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 68/100
JuliusBrussee/caveman#1449 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 78/100
linagora/twake-calendar-frontend#1924 ·
維護者通常 1 天內回覆
-
check:passed streams:add
難度 1/5 1 小時以內 新手友好度 65/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 70/100
libnativeapi/nativeapi#21 ·
-
難度 2/5 1-3 小時 新手友好度 62/100
GiganticMinecraft/seichi-playguide#183 ·
維護者通常 1 天內回覆