From 9385cf029b097dbf90bab4016f23fa5027f7625f Mon Sep 17 00:00:00 2001 From: Nawwar14 <147875072+Nawwar14@users.noreply.github.com> Date: Thu, 24 Oct 2024 02:36:40 +0300 Subject: [PATCH] T51V3 --- src/components/Map/Map.tsx | 4 ++-- src/hooks/use-map.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Map/Map.tsx b/src/components/Map/Map.tsx index ac7cff7..6ce1321 100644 --- a/src/components/Map/Map.tsx +++ b/src/components/Map/Map.tsx @@ -34,7 +34,7 @@ function Map(props: MainPageProps): JSX.Element { const {offers, selectedPoint} = props; const mapRef = useRef(null); - const map = useMap(mapRef, "Амстердам"); + const map = useMap(mapRef, 'Амстердам'); useEffect(() => { if (map) { @@ -57,7 +57,7 @@ function Map(props: MainPageProps): JSX.Element { map.removeLayer(markerLayer); }; } - }, [map, offers]); + }, [map, offers,selectedPoint]); return
; } diff --git a/src/hooks/use-map.tsx b/src/hooks/use-map.tsx index dc12e3a..e8f617d 100644 --- a/src/hooks/use-map.tsx +++ b/src/hooks/use-map.tsx @@ -29,7 +29,7 @@ function useMap( instance.addLayer(layer); setMap(instance); - isRenderedRef.current = true + isRenderedRef.current = true; } }, [mapRef, city]);