Is there any way to filter the results based on a country ? #889
-
HI, As the title suggests, I was wondering if you could filter the results based on a country. For example if i type "John street" I want to show only results from US, if exists, even though there may be a John street in UK. I've been battling with this for 2 days now and I can't seem to get a hold of it. Thanks in advance and have a great day! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
i found the answer
you need to set the |
Beta Was this translation helpful? Give feedback.
i found the answer
const { ready, value, suggestions: { status, data }, setValue, } = usePlacesAutocomplete({ requestOptions: { componentRestrictions: { country: 'ro' } }, defaultValue: "", debounce: 300, });
you need to set the
componentRestrictions
inrequestOptions