ErrorPro / react-google-autocomplete

React components for google places API.
MIT License
474 stars 113 forks source link

Can we use the "types" option with the usePlacesAutocompleteService? #211

Closed yaroslav-perec closed 1 year ago

yaroslav-perec commented 1 year ago

Hi!

I'm trying to set types: ['(address)'] using usePlacesAutocompleteService like in the example below and it doesn't work, should it work? If yes, what am I doing wrong?

  const { placesService, placePredictions, getPlacePredictions, isPlacePredictionsLoading } =
    usePlacesService({
      apiKey: 'my_api_key',
      debounce: 200,
      options: {
        componentRestrictions: { country: 'au' },
        types: ['(address)'],
      },
    });
yaroslav-perec commented 1 year ago

After some research everything seems to work, it's just that ['(address)'] is not a valid value for the "types" field