react-google-maps-api
react-google-maps-api copied to clipboard
Google Maps API call giving low lighthouse score
I have wrapped my application with <LoadScript /> in my app.js as I need the package in multiple places across the application. When I run the lighthouse check on the site, it gives very low Performance score and says that main thread is blocked by 3rd-party scripts.
On blocking the maps.googleapis.com request, the score shows 90+ score most of the time. Is there any way I can defer / async the API call or improve the score in any way?
Yes, you can defer to render LoadScript until user interaction, for example pressing a button, or just setTimeOut in UseEffect or componentDidMount. Please do not forget to clearTimeout.