Skip to content

Is there any way to filter the results based on a country ? #889

Discussion options

You must be logged in to vote

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 in requestOptions

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Zaimwa9
Comment options

Answer selected by CosminMocanu97
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants