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

What's the type of mapView elements like Marker and MapView, Typescript react native?

$
0
0

I am using typescript with MapView and its components, I need to know the type of mapView and marker to put in the interface,

That's the code,

interface SelectInput {  style?: StyleProp<ViewStyle>;  isMapSelector?: boolean;  isModalVisable?: boolean;  markerLocation?: MarkerProps ; // What sould I type here  initialRegion?: MapViewProps; // What sould I type here  onMapViewOress?: () => object;  onOpen: () => void;  onClose: () => void;}<MapView   initialRegion={initialRegion}   //Warining under initialRegion   onPress={onMapViewOress}   style={{flex: 1}}><Marker coordinate={markerLocation} /> //Warining under coordinate</MapView>

That's the warning that appears to me under initialRegion is,"No overload matches this call.Overload 1 of 2, '(props: MapViewProps | Readonly): MapView', gave the following error.Type 'MapViewProps | undefined' is not assignable to type 'Region | undefined'.Type 'MapViewProps' is missing the following properties from type 'Region': latitude, longitude, latitudeDelta, longitudeDelta"

That's the warning that appears to me under coordinate is,"No overload matches this call.Overload 1 of 2, '(props: MarkerProps | Readonly): Marker', gave the following error.Type 'MarkerProps | undefined' is not assignable to type 'LatLng | AnimatedRegion'.Type 'undefined' is not assignable to type 'LatLng | AnimatedRegion'."


Viewing all articles
Browse latest Browse all 6287

Trending Articles



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