I’m encountering an issue with my React Native app using Expo. On my home page, I request location permissions using expo-location, and it works perfectly. However, when I navigate to my MapView page, I get a type error. If I remove the location permission request code, the MapView works fine.
Here is the relevant code from my home page:
import * as Location from 'expo-location';
const [status, requestPermission] = Location.useForegroundPermissions();
Here are the versions of the packages I’m using:
“expo”: “~51.0.9”
“expo-location”: “~17.0.1”
“react-native-maps”: “1.14.0”
The error occurs only when I navigate to the MapView page after having the permission request on the home page. Without the permission request, the MapView page works without issues.
Has anyone experienced a similar issue or have any suggestions on how to resolve this?
Thanks in advance!
try to update the map view to follow the user