Closed russmenum closed 2 years ago
Are you sorted this? If you change the options.types to geocode, you can get a full address.
options: { componentRestrictions: { country: "us" }, types: ["geocode"], },
Feel free to reopen it if that still doesn't work for you
It seems the core problem is onload it is not setting the API key?
Google maps places API must be loaded.
<Autocomplete
className="location"
// apiKey={process.env.REACT_APP_GOOGLE_MAPS_API}
apiKey={googleKeyState}
onPlaceSelected={(place) => {
//console.log(place);
handleLocation(place);
}}
options={{
componentRestrictions: { country: "us" },
types: ["geocode"],
}}
/>
Does not matter if I pass it from env, or state, or directly there as a string. It won't load it until I refresh the screen at least one time.
Is there some load for the apiKey I am missing so it will load first time and be ready
Feel free to reopen it if that still doesn't work for you
I do not think I can when you close it for me?
Am trying to get a full address, but this library seems to only work for the city, not the full address?