Below is the Code what i am trying to execute using typescript and react-native and it gives me typescript error in VSCODE IDE
import { TouchableOpacity } from "react-native";
<TouchableOpacity
primary
transparent
onPress={this.send}
>
<Text style={styles.btnText}>Send</Text>
</TouchableOpacity>
gives following typescript error in VSCode:
(alias) class TouchableOpacity
import TouchableOpacity
No overload matches this call.
Overload 1 of 2, '(props: Readonly<TouchableOpacityProps>): TouchableOpacity', gave the following error.
Type '{ children: Element; primary: true; transparent: true; onPress: () => void; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<TouchableOpacity> & Readonly<TouchableOpacityProps> & Readonly<{ children?: ReactNode; }>'.
Property 'primary' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<TouchableOpacity> & Readonly<TouchableOpacityProps> & Readonly<{ children?: ReactNode; }>'.
Overload 2 of 2, '(props: TouchableOpacityProps, context?: any): TouchableOpacity', gave the following error.
Type '{ children: Element; primary: true; transparent: true; onPress: () => void; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<TouchableOpacity> & Readonly<TouchableOpacityProps> & Readonly<{ children?: ReactNode; }>'.
Property 'primary' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<TouchableOpacity> & Readonly<TouchableOpacityProps> & Readonly<{ children?: ReactNode; }>'.ts(2769)