We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ca5c5c6 commit b703210Copy full SHA for b703210
1 file changed
src/withGoogleMap.jsx
@@ -46,15 +46,16 @@ export function withGoogleMap(BaseComponent) {
46
}
47
48
handleComponentMount(node) {
49
- if (this.state.map || node === null) {
50
- return
51
- }
52
warning(
53
`undefined` !== typeof google,
54
`Make sure you've put a <script> tag in your <head> element to load Google Maps JavaScript API v3.
55
If you're looking for built-in support to load it for you, use the "async/ScriptjsLoader" instead.
56
See https://github.com/tomchentw/react-google-maps/pull/168`
57
)
+
+ if (this.state.map || node === null || google == null) {
+ return
58
+ }
59
// https://developers.google.com/maps/documentation/javascript/3.exp/reference#Map
60
const map = new google.maps.Map(node)
61
this.setState({ map })
0 commit comments