Closed radikris closed 1 year ago
The options should looks like this:
apiOptions={{
options: {
types: ["(cities)"],
componentRestrictions: { country: "hu" },
}
}}
I think you should look here https://github.com/Tintef/react-google-places-autocomplete/issues
Stackoverflow question: https://stackoverflow.com/questions/74395951/react-google-autocomplete-options-not-working
I am using react-google-autocomplete with react-hook-form: And when I try to add options parameters to the Component (which should filter my API predictions down to my country, and only cities, but it's clearly not working:
And the autocomplete component:
When I check the network log, you can see no options added to the query: Request URL:
https://maps.googleapis.com/maps/api/place/js/AutocompletionService.GetPredictionsJson?1sLondon&4shu-HU&15e3&21m1&2e1&callback=_xdc_._dpoln7&key=APIKEY&token=111550
When I try to search for London, there should be no option, because I restrict to 'hu'- Hungary and only city: