Столкнулся с проблемой при реализации react google maps
,
при запуске проекта ошибка module not found: Error: Can't resolve 'google-maps-react'
.
Делал npm uninstall --save google-maps-react
.
Теперь при установке npm install --save google-maps-react
, выходят ошибки ERR в терминале.
Код файла MapContainer, который я импортирую в главную страницу
import React, { Component } from 'react';
import { Map, GoogleApiWrapper } from 'google-maps-react';
const mapStyles = {
width: '100%',
height: '100%'
};
export class MapContainer extends Component {
render() {
return (
<Map
google={this.props.google}
zoom={4}
style={mapStyles}
initialCenter={{
lat: 6.2518401,
lng: -75.563591
}}
/>
);
}
}
export default GoogleApiWrapper({
apiKey: '...'
})(MapContainer);