File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -73,8 +73,10 @@ function usePlacesWidget(props) {
7373 if ( ref && ! ref . current ) ref . current = inputRef . current ;
7474
7575 var handleAutoComplete = function handleAutoComplete ( ) {
76+ var _google$maps ;
77+
7678 if ( typeof google === "undefined" ) return console . error ( "Google has not been found. Make sure your provide apiKey prop." ) ;
77- if ( ! google . maps . places ) return console . error ( "Google maps places API must be loaded." ) ;
79+ if ( ! ( ( _google$maps = google . maps ) !== null && _google$maps !== void 0 && _google$maps . places ) ) return console . error ( "Google maps places API must be loaded." ) ;
7880 if ( ! inputRef . current instanceof HTMLInputElement ) return console . error ( "Input ref must be HTMLInputElement." ) ;
7981 autocompleteRef . current = new google . maps . places . Autocomplete ( inputRef . current , config ) ;
8082
Original file line number Diff line number Diff line change 11{
22 "name" : " react-google-autocomplete" ,
3- "version" : " 2.7.1 " ,
3+ "version" : " 2.7.2 " ,
44 "description" : " React component for google autocomplete." ,
55 "main" : " index.js" ,
66 "types" : " index.d.ts" ,
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ export default function usePlacesWidget(props) {
5959 "Google has not been found. Make sure your provide apiKey prop."
6060 ) ;
6161
62- if ( ! google . maps . places )
62+ if ( ! google . maps ? .places )
6363 return console . error ( "Google maps places API must be loaded." ) ;
6464
6565 if ( ! inputRef . current instanceof HTMLInputElement )
You can’t perform that action at this time.
0 commit comments