File tree 3 files changed +5
-3
lines changed
3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -73,8 +73,10 @@ function usePlacesWidget(props) {
73
73
if ( ref && ! ref . current ) ref . current = inputRef . current ;
74
74
75
75
var handleAutoComplete = function handleAutoComplete ( ) {
76
+ var _google$maps ;
77
+
76
78
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." ) ;
78
80
if ( ! inputRef . current instanceof HTMLInputElement ) return console . error ( "Input ref must be HTMLInputElement." ) ;
79
81
autocompleteRef . current = new google . maps . places . Autocomplete ( inputRef . current , config ) ;
80
82
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " react-google-autocomplete" ,
3
- "version" : " 2.7.1 " ,
3
+ "version" : " 2.7.2 " ,
4
4
"description" : " React component for google autocomplete." ,
5
5
"main" : " index.js" ,
6
6
"types" : " index.d.ts" ,
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ export default function usePlacesWidget(props) {
59
59
"Google has not been found. Make sure your provide apiKey prop."
60
60
) ;
61
61
62
- if ( ! google . maps . places )
62
+ if ( ! google . maps ? .places )
63
63
return console . error ( "Google maps places API must be loaded." ) ;
64
64
65
65
if ( ! inputRef . current instanceof HTMLInputElement )
You can’t perform that action at this time.
0 commit comments