hibiken / react-places-autocomplete

React component for Google Maps Places Autocomplete
https://hibiken.github.io/react-places-autocomplete/
MIT License
1.38k stars 388 forks source link

How can i restrict places search to a specific country like "US"? #370

Open munibahina opened 3 years ago

munibahina commented 3 years ago

Do you want to request a feature or report a bug?

What is the current behavior?

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

What is the expected behavior?

Which versions of ReactPlacesAutocomplete, and which browser / OS are affected by this issue?

faraz-dd commented 2 years ago

This should work


<PlacesAutocomplete
  searchOptions={{
    componentRestrictions: {
       country: 'US'
    }
  }}
/>
SasiKumar-Ramesh commented 2 years ago

@munibahina They have already provided a workaround for this. You can check this closed issue

anbturki commented 2 years ago

This should work

<PlacesAutocomplete
  searchOptions={{
    componentRestrictions: {
       country: 'US'
    }
  }}
/>

@munibahina This should solve the issue, i would encourage you to close the issue.