react-native-google-places-autocomplete icon indicating copy to clipboard operation
react-native-google-places-autocomplete copied to clipboard

Restricting search to 2+ countries?

Open allenwalker3 opened this issue 1 year ago • 1 comments

Describe the problem

I want to limit the search to include both US and CA.

Reproduction - (required - issue will be closed without this)

Click to expand!
<GooglePlacesAutocomplete
           placeholder='Enter Location'
           fetchDetails={true}
           onPress={(data, details) => {
             // 'details' is provided when fetchDetails = true
           }}
           query={{
             key: "MY_API_KEY",
             language: 'en'
             **//components: { country: ["us", "ca"] }  --> doesn't work**
             components: 'country:us',
           }}
    />
  
  

Additional context

  • Library Version: 2.5.6

  • React Native Version: 0.72.4

  • [x ] iOS

  • [x ] Android

  • [ ] Web

  • [x ] I am using expo

allenwalker3 avatar Dec 15 '23 22:12 allenwalker3

You can use as below components: 'country:us|country:ca'

But

Currently, you can use componentRestrictions to filter by up to 5 countries (from google)

lenkaborshch avatar Dec 27 '23 13:12 lenkaborshch