Skip to content

Commit

Permalink
Fix instanceof check (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
patdx committed Jan 29, 2024
1 parent 03271dd commit abe3fa3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/usePlacesWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function usePlacesWidget(props) {

if (typeof google === "undefined") return console.error("Google has not been found. Make sure your provide apiKey prop.");
if (!((_google$maps = google.maps) !== null && _google$maps !== void 0 && _google$maps.places)) return console.error("Google maps places API must be loaded.");
if (!inputRef.current instanceof HTMLInputElement) return console.error("Input ref must be HTMLInputElement.");
if (!(inputRef.current instanceof HTMLInputElement)) return console.error("Input ref must be HTMLInputElement.");
autocompleteRef.current = new google.maps.places.Autocomplete(inputRef.current, config);

if (autocompleteRef.current) {
Expand Down
2 changes: 1 addition & 1 deletion src/usePlacesWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default function usePlacesWidget(props) {
if (!google.maps?.places)
return console.error("Google maps places API must be loaded.");

if (!inputRef.current instanceof HTMLInputElement)
if (!(inputRef.current instanceof HTMLInputElement))
return console.error("Input ref must be HTMLInputElement.");

autocompleteRef.current = new google.maps.places.Autocomplete(
Expand Down

0 comments on commit abe3fa3

Please sign in to comment.