MapView failing inside a View


#1

I dont understand why the MapView suddenly fails to load if its inside a View element.
As soon as I remove the View encapsulating it, it loads fine …

import React from 'react';
import { MapView, Marker } from 'expo';
import { Text, View, StyleSheet, Button, Dimensions } from 'react-native';
  
export default class App extends React.Component {
  render() {
    return (
      
    <View style={styles.centered}>
        <MapView
        style={{ flex: 1 }}
        initialRegion={{
          latitude: 37.78825,
          longitude: -122.4324,
          latitudeDelta: 0.0922,
          longitudeDelta: 0.0421,
        }}
        />
      </View>
   );
  }
}```

#2

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.