I have been trying to use the methods on MapView to animate to a region, to do that I need access to the ref but it is undefined. Everything else is working properly, I just can't get the ref and anytime I try to call a method e.g `
this.map.animateToRegion({
latitude: 0,
longitude: 0,
latitudeDelta: 1,
longitudeDelta: 1
});
I get an error saying:
Cannot read property 'animateToRegion' of undefined
<MapView
ref={r => this.map = r}
mapPadding={{ top: 0, left: 0, right: 0, bottom: 400 }}
provider='google'
style={{ flex: 1 }}
region={this.region}
>
{this.renderBarberMarkers()}
</MapView>