I am new to react and trying to create a map element that shows on the app. However I believe I am doing something wrong when I say I am exporting the default class App. This is the error I get "React.createElement: type is invalid -- expected a string (for built in components) or a class/function (for composite components) but got: "undefined"" I have my code below.
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { MapView } from 'expo';
export default class App extends React.Component {
constructor(props) {
super(props);
this.state = {
region: {
latitude: 37.78825,
longitude: -122.4324,
latitudeDelta: 0.922,
longitudeDelta: 0.0421,
}
}
}
render() {
return (
<View style={styles.container}>
<Text>Home Sreen</Text>
<MapView
initialRegion={this.state.region}
showsCompass={true}
rotateEnabled={false}
style={{flex: 1}}
/>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
},
});