Reputation: 455
I am using expo v25.0.0 to develop mobile app with react native. my react-native version is the latest one. so the issue is that react-native-maps has [email protected] and [email protected] as dependencies while in my package.json, since my expo version is v25.0.0, I have [email protected] and [email protected] as deps.
so running the app I have this error:
peer dep missing: [email protected], required by [email protected]
peer dep missing: [email protected], required by [email protected]
someone can tell me what I am supposed to do please?
I found also this library: react-native-mapbox-gl, do you think that it can be a good alternative to use it instead of react-native.maps?
thank you
Upvotes: 0
Views: 627
Reputation: 662
You shouldn't need to bring in react-native-maps
separately if you want to use them with Expo
. Expo
has that library already built in.
Here's all you need to import the MapView
, straight from the Expo
documentation:
(They provided some sample coordinates for the lat/lng in the initialRegion
, but you can obviously change these to whatever you'd like.)
https://docs.expo.io/versions/latest/sdk/map-view.html
import React from 'react';
import { MapView } from 'expo';
export default class App extends React.Component {
render() {
return (
<MapView
style={{ flex: 1 }}
initialRegion={{
latitude: 37.78825,
longitude: -122.4324,
latitudeDelta: 0.0922,
longitudeDelta: 0.0421,
}}
/>
);
}
}
Upvotes: 2