ErrorPro / react-google-autocomplete

React components for google places API.
MIT License
473 stars 114 forks source link

Force call onPlaceSelected with default value #162

Closed wnieves closed 2 years ago

wnieves commented 2 years ago

Hi I'm using autocomplete component find some places in my app but I need get the place_id if I put a default address that I have in some prop, in this case which is the best way to achieve it?

Thanks!

ErrorPro commented 2 years ago

The best way would be to use usePlacesAutocompleteService and call its API getPlacePredictions then you can see if there's any result for such address and pick the one you need.