Open png-prakash opened 1 year ago
import useGoogle from "react-google-autocomplete/lib/usePlacesAutocompleteService"; import Constants from '../../lib/Constants'; const GoogleAddress = (props) => { const [value, setValue] = useState(""); const {placesService, placePredictions, getPlacePredictions} = useGoogle({ apiKey: Constants.GOOGLE_ADDRESS_API_KEY, options: { componentRestrictions: { country: props.country }, }, });
When change the country in dropdown list is possible to get the addresses based on that particular country?
@png-prakash You have two options:
const [autocompleteOptions, setAutocompleteOptions] = useState({ componentRestrictions: { country: "cl" }, types: ["address"], })
When change the country in dropdown list is possible to get the addresses based on that particular country?