all repos — caroster @ c6cb98d73582dce9c54b6fc15d62a605fb2f74c2

[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;