'I get error message when I try to use animateToRegion
I tried to use code from this website: https://serveanswer.com/questions/react-native-maps-animatetoregion-does-not-work-with-region-or-initialregion Unfortunately I have an error message. Here is the code and error message that I get. Thanks for your help.
const mapRef = React.useRef<MapView >(null);
<MapView
ref={mapRef}
initialRegion={initialRegion}
onRegionChangeComplete={handleRegionChange}
/>
mapRef.current?.animateToRegion({
latitude: selectedCoordinates.lat,
longitude: selectedCoordinates.lng,
longitudeDelta: 0.004,
latitudeDelta: 0,
});
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

