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:
Eric Gullickson
2025-11-04 19:33:12 -06:00
parent def2494ed7
commit 4151f58fa5

View File

@@ -37,7 +37,7 @@ export function loadGoogleMaps(): Promise<void> {
// Create script tag // Create script tag
const script = document.createElement('script'); 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.async = true;
script.defer = true; script.defer = true;