types.d.ts doesn't type-check against React Native 0.88: Touchable, ScrollViewProps and VirtualizedListProps

Offen Anfängerfreundlich
#548 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 12 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
72/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
react-native, typescript
Bereich
mobile-dev

Rechercherichtung

Beginne bei types.d.ts (Zeilen 1-30), wo Touchable, ScrollViewProps und VirtualizedListProps augmented sind. Prüfe die Typen von React Native 0.88, um entfernte exports/generics zu sehen, und korrigiere dann die extends-Klauseln. Erledigt, wenn npx tsc im repro repo keine Fehler aus react-native-css/types.d.ts meldet.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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):

  • Touchable is no longer exported by react-native.
  • interface ScrollViewProps extends ViewProps, ScrollViewPropsIOS, ScrollViewPropsAndroid, Touchable clashes with 0.88's own ScrollViewProps, and the className the file adds to ViewProps and ImagePropsBase makes ScrollViewProps, ImageBackgroundProps and KeyboardAvoidingViewProps unable to extend both of their bases.
  • VirtualizedListProps is no longer generic, so FlatListProps<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
  1. Clone the reproducible example: a package.json with react-native 0.88.1 and react-native-css 0.0.0-nightly.2421ea7, a tsconfig.json with strict and skipLibCheck: false, and an index.ts holding only import type {} from 'react-native-css/types';.
  2. npm install --ignore-scripts
  3. npx 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

Vorherrschende Sprache
TypeScript
Sterne
166
Forks
45
Ø Merge
17 T. 22 Std.
Gemergte PRs (30 T.)
3

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus nativewind/react-native-css

Alle Issues in nativewind/react-native-css

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.