From 2f3264279a1aca5164ced0bb4f5c40e46c608a2c Mon Sep 17 00:00:00 2001 From: Keno Schwalb Date: Mon, 23 May 2016 18:29:07 +0200 Subject: [PATCH] fix(Geosuggest): initialise Google Maps in componentWillMount instead of componentDidMount fixes #130 --- src/Geosuggest.jsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Geosuggest.jsx b/src/Geosuggest.jsx index b805cc50..f0cb26e4 100644 --- a/src/Geosuggest.jsx +++ b/src/Geosuggest.jsx @@ -49,9 +49,7 @@ class Geosuggest extends React.Component { * Google api sdk object will be obtained and cached as a instance property. * Necessary objects of google api will also be determined and saved. */ - componentDidMount() { - this.setState({userInput: this.props.initialValue}); - + componentWillMount() { var googleMaps = this.props.googleMaps || (window.google && // eslint-disable-line no-extra-parens window.google.maps) ||