Reputation: 181
Code:
import MapView from 'react-native-maps'
export default class mapTestProject extends Component {
render() {
return (
<MapView>
style = {styles.map}
showsUserLocation = {false}
followUserLocation = {false}
zoomEnabled = {true}
/>
);
}
}
const styles = StyleSheet.create({
map: {
height: 400,
marginTop: 80
},
});
AppRegistry.registerComponent('mapTestProject', () => mapTestProject);
I am trying to create a sample map project.It gives "x.match not a function" error.Please help me on fixing this issue.any help will be appreicated.thanks in advance
Upvotes: 1
Views: 994
Reputation: 5217
Had the same issue with the latest version of react-native-maps v0.14.0 Temporally using v0.13.1 solved the problem:
npm install [email protected] --save
react-native link
Upvotes: 0
Reputation: 281874
React Components name must begin with upper case letter
since all lower case are reserved for the HTML tags like div, p, span, li etc
import MapView from 'react-native-maps'
export default class MapTestProject extends Component {
render() {
return (
<MapView>
style = {styles.map}
showsUserLocation = {false}
followUserLocation = {false}
zoomEnabled = {true}
/>
);
}
}
const styles = StyleSheet.create({
map: {
height: 400,
marginTop: 80
},
});
AppRegistry.registerComponent('mapTestProject', () => MapTestProject);
Upvotes: 1