I need to add google maps api key into my .env file.
I configured my webpack according to this config and use it in my map component.
When I console log this key I can see it in console, But while using it with map, map opened just a second then I got a warning screen.
Webpack file:
plugins: [
new Dotenv({ systemvars: true }),
],
Map component:
const { isLoaded } = useLoadScript({
googleMapsApiKey: process.env.REACT_APP_API_KEY,
libraries: [GOOGLE_MAP_PLACES_LIBRARY],
});
.env file:
REACT_APP_API_KEY : "someKey"
Error that i got after a second
New contributor
rufat29 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.