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

every first react-native component gets typescript error

$
0
0

When I use the Text component of react-native, I get this error:

No overload matches this call.  Overload 1 of 2, '(props: TextProps | Readonly<TextProps>): Text', gave the following error.    Type '{ children: string; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<Text> & Readonly<TextProps>'.  Overload 2 of 2, '(props: TextProps, context: any): Text', gave the following error.    Type '{ children: string; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<Text> & Readonly<TextProps>'.ts(2769)

My code:

import {Text} from 'react-native'...<Text>123</Text>

Viewing all articles
Browse latest Browse all 6287

Trending Articles



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