So I am trying to create a map component using the google maps API and React.
Following this tutorial:
My code looks like this:
import React from 'react';
import ReactDOM from 'react-dom';
import { Map, GoogleApiWrapper } from 'google-maps-react';
class App extends React.Component {
render() {
return (
<div>
<p>Hello Google Maps</p>
<Map
google={this.props.google}
/>
</div>
);
}
}
export default GoogleApiWrapper({
apiKey: ('MY_API_KEY')
})(App);
ReactDOM.render(<App />, document.getElementById('app'));
But there is no map rendering on the screen, just a div with the text Loading map...
.
Is there anything obvious that I’m doing wrong here? There are no error messages in the console. I have been trying to debug this for hours