Search code examples
react-nativeexporeact-component

React Native Mapview component into Expo project


I wish to add the React Native MapView Component to the new project I have created using expo. The instructions explain that I need to modify files in the iOS and Android folders, but expo doesn't generate iOS and Android folders, right?

Can I use this component in my project?


Solution

  • It's included as per https://docs.expo.io/versions/latest/sdk/map-view/

    "No setup required for use within the Expo app, or within a standalone app for iOS."

    import React from 'react';
    import MapView from 'react-native-maps';
    
    export default class App extends React.Component {
      render() {
        return (
          <MapView style={{flex: 1}} />
        );
      }
    }