I am using typescript and react-native-maps to create a react-native application. I am following one of their examples given here.
Before I try to call the methods I have to create a ref as shown in the example but I am getting the following error.
"Property 'map' does not exist on type 'Map'"
Here's my code.
import React, { Component } from "react";
import MapView, { Marker } from "react-native-maps";
export default class Map extends Component {
constructor(props: any) {
super(props);
this.state = {
region: {
latitude: LATITUDE,
longitude: LONGITUDE,
latitudeDelta: LATITUDE_DELTA,
longitudeDelta: LONGITUDE_DELTA
},
coordinate: {
latitude: LATITUDE,
longitude: LONGITUDE
}
};
}
render() {
return (
<MapView
// Getting that error in this line
ref={map => { this.map = map; }}
style={{ flex: 1 }}
region={this.state["region"]}
>
<Marker coordinate={this.state["coordinate"]} />
</MapView>
);
}
}
I tried some solutions that were given here but i suspect its not a solution for react-native?