Open
Description
I have an AddressSuggestion.js
component which uses usePlacesAutocompleteService like this
import usePlacesService from "react-google-autocomplete/lib/usePlacesAutocompleteService";
const {
placePredictions,
getPlacePredictions,
isPlacePredictionsLoading,
} = usePlacesService({
apiKey: process.env.REACT_APP_MAPS_API_KEY ?
`${process.env.REACT_APP_MAPS_API_KEY}&loading=async` :
"keyUnavailable",
debounce: 500
});
the problem is if I am trying to use the same component two times on a single page (single parent component), then I am getting this Uncaught runtime error:
usePlacesAutocompleteService.js:110 Uncaught (in promise)
TypeError: Cannot read properties of undefined (reading 'AutocompleteService')
at buildService (usePlacesAutocompleteService.js:110:1)
at usePlacesAutocompleteService.js:118:1
although the component seems to work fine (in development though, haven't checked in production)
Metadata
Metadata
Assignees
Labels
No labels