diff --git a/src/withGoogleMap.jsx b/src/withGoogleMap.jsx index a4bf3c41..ec5198b0 100644 --- a/src/withGoogleMap.jsx +++ b/src/withGoogleMap.jsx @@ -56,8 +56,10 @@ export function withGoogleMap(BaseComponent) { See https://github.com/tomchentw/react-google-maps/pull/168` ) // https://developers.google.com/maps/documentation/javascript/3.exp/reference#Map - const map = new google.maps.Map(node) - this.setState({ map }) + if (typeof google !== "undefined"){ + const map = new google.maps.Map(node) + this.setState({ map }) + } } render() {