Bug Report: `children` type missing when using components import with Strict ABI
Les mainteneurs répondent en général sous 3 jours
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 35/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- À l'abandon
- Stack technique
- react-native, typescript
- Domaine
- frontend
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- TypeScript
- Étoiles
- 166
- Forks
- 45
- Merge moyen
- 13 j 14 h
- PR mergées (30 j)
- 1
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de nativewind/react-native-css
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
nativewind/react-native-css#545 ·
Les mainteneurs répondent en général sous 3 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
nativewind/react-native-css#544 ·
Les mainteneurs répondent en général sous 3 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
nativewind/react-native-css#543 ·
Les mainteneurs répondent en général sous 3 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
nativewind/react-native-css#540 ·
Les mainteneurs répondent en général sous 3 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
nativewind/react-native-css#538 ·
Les mainteneurs répondent en général sous 3 jours
Toutes les issues de nativewind/react-native-css
Issues similaires
-
Shell: serve the home app's Cookie Policy on a hard reloadPeut-être pris @2001anshkaushik l’a pris aujourd’hui. Ouvertefeature module:ai
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
rocketride-org/rocketride-server#2899 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
wazuh/wazuh-dashboard-plugins#9551 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
gofish-graphics/gofish-graphics#1252 ·
Les mainteneurs répondent en général sous 1 jour
-
optimization P3 size:XS
Difficulté 1/5 1-3 heures Accessibilité débutants 88/100
josephfung/curia#2366 ·
Les mainteneurs répondent en général sous 1 jour
-
stranded-follow-up sweep trusts any issue whose body carries the marker as the tracking issueOuvertetype:bug
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
nightgauge/nightgauge#2688 ·
Les mainteneurs répondent en général sous 1 jour