react-places-autocomplete
react-places-autocomplete copied to clipboard
Get result suggestions in countries only
Feature request
I can't search for countries
I should be able to add country as searchOption Types and get result in countries level.
I want the results in countries like if i put cities option then i get cities level suggestions but there is no option for countries or i might be doing wrong. i have checked the places api documentation but couldn't do anything
if (streetAddress) {
return ["address"];
} else if (country) {
return ["country"]; // Have also tried 1. 'country' 2. '(country)' 3. ['locality','country'] and ['countries'] etc
} else {
return ["(cities)"];
}
};
const searchOptions = {
types: checkType(),
};```
try this?
<PlacesAutocomplete
searchOptions={{
componentRestrictions: {
country: 'US'
}
}}
/>
@williamtan2251 works perfectly, thank you! 👌🏼