From 16a72b311094dd65476064010ce4534959ccfad2 Mon Sep 17 00:00:00 2001 From: Jeremy Myers Date: Fri, 27 Jun 2025 09:30:35 -0400 Subject: [PATCH] Add deps to useEffect arrays --- src/components/layers/SourcesLayer.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/layers/SourcesLayer.tsx b/src/components/layers/SourcesLayer.tsx index fad6071..ae356d8 100644 --- a/src/components/layers/SourcesLayer.tsx +++ b/src/components/layers/SourcesLayer.tsx @@ -144,7 +144,7 @@ export function SourcesLayer({ map.removeOverlay(popupOverlay); map.removeInteraction(select); }; - }, []); + }, [mapRef.current]); useEffect(() => { if (mapRef.current) { @@ -157,7 +157,7 @@ export function SourcesLayer({ handleSourceClickRef.current = handleSourceClick; selectInteractionRef.current?.on('select', handleSourceClick); } - }, [handleSourceClick]); + }, [handleSourceClick, selectInteractionRef.current]); useEffect(() => { const map = mapRef.current;