Fix Google Maps async loading parameter
Add loading=async query parameter to Google Maps API URL to prevent synchronous DOM manipulation. This fixes the warning: 'Google Maps JavaScript API has been loaded directly without loading=async' The loading=async parameter tells Google Maps to defer API initialization until the script is fully loaded, preventing race conditions with React's DOM management. 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -37,7 +37,7 @@ export function loadGoogleMaps(): Promise<void> {
|
||||
|
||||
// Create script tag
|
||||
const script = document.createElement('script');
|
||||
script.src = `https://maps.googleapis.com/maps/api/js?key=${apiKey}&libraries=places`;
|
||||
script.src = `https://maps.googleapis.com/maps/api/js?key=${apiKey}&loading=async&libraries=places`;
|
||||
script.async = true;
|
||||
script.defer = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user