Open TimWalkidenWebPro opened 7 months ago
Wow, I've been just looking for this feature :O
You must update to the latest version and replace useLoadScript with the newer useJsApiLoader
import { useJsApiLoader } from "@react-google-maps/api";
@rhadooqoo I'm not sure that solves the problem because this library is still using v1.16.2 of @googlemaps/js-api-loader, but that library only fixed loading=async
as of v1.16.3 here.
@sderrow Updated to latest version and it worked for me. Thanks @nitya-nalamari 👍
This issue should be closed since it is resolved.
Did not work for me (updated to 2.19.3). For now, injecting with the API key till the library is updated.
googleMapsApiKey: `${import.meta.env.VITE_GOOGLE_MAP_KEY}&loading=async`,
@Vitallyz loading=async
was added for the LoadScript
component in my PR. My PR was merged only a few days ago so not sure if it has been released yet.
The fix you mentioned is what I am currently using as well 😅
The following warning has started to appear when using the following @react-google-maps/api/src/LoadScriptNext.
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
Is their a fix for this?