Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

Why i can not use ImageBackground's children components of react-native in Typescript

$
0
0

[enter image description here][1]

<ImageBackground   style={styles.truckItemBadgeBackground}   imageStyle={styles.truckItemBadgeImage}   source={paginationData[item.status].image}><Text style={styles.truckItemBadgeText}>       HI</Text></ImageBackground>

Hello everyone, I am changing my React Native source code from Javascript to Typescript, after change source code, the ImageBackground return an error :

No overload matches this call.Overload 1 of 2, '(props: ImageBackgroundProps | Readonly): ImageBackground', gave the following error.Type '{ children: Element; style: { borderRadius: number; padding: number; }; imageStyle: { borderRadius: number; }; source: any; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly'.Property 'children' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly'.Overload 2 of 2, '(props: ImageBackgroundProps, context: any): ImageBackground', gave the following error.Type '{ children: Element; style: { borderRadius: number; padding: number; }; imageStyle: { borderRadius: number; }; source: any; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly'.Property 'children' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly'.Blockquote

Can everybody help me with this problem, I am very appreciated it.


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>