Tintef / react-google-places-autocomplete

React Google Places Autocomplete input -- fully customizable
https://tintef.github.io/react-google-places-autocomplete
MIT License
362 stars 160 forks source link

Getting warning regarding "Google Maps JavaScript API has been loaded directly without loading=async. This can result in suboptimal performance. For best-practice loading patterns please see https://goo.gle/js-api-loading #344

Open sadanandapradhan opened 5 months ago

sadanandapradhan commented 5 months ago

Google Maps JavaScript API has been loaded directly without loading=async. This can result in suboptimal performance. For best-practice loading patterns please see https://goo.gle/js-api-loading.. Getting the same warning again and again ... After changed at Script level also .. Here is my Script tag <script async defer src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap"> and also tried "<script async defer loading="async" src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=places&callback=showNewLocationFunc"> " .. So any one please guide me

lightstrike commented 5 months ago

@sadanandapradhan Add the async script attribute and loading=async into the src value as noted in the docs:

<script async
    src="https://maps.googleapis.com/maps/api/js?key=&loading=async&libraries=places&callback=initMap">
</script>
sadanandapradhan commented 5 months ago

Thank You @lightstrike its working properly