all repos — caroster @ mdraps-main-patch-e989

[Octree] Group carpool to your event https://caroster.io

frontend/containers/Map/MapController.tsx (view raw)

 1import {useMap} from 'react-leaflet';
 2import useMapStore from '../../stores/useMapStore';
 3
 4const MapController = () => {
 5  const map = useMap();
 6  const setMap = useMapStore(s => s.setMap);
 7  const storedMap = useMapStore(s => s.map);
 8  map.scrollWheelZoom.disable();
 9
10  if (storedMap !== map) setMap(map);
11
12  return <></>;
13};
14
15export default MapController;