all repos — caroster @ main

[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
 9  if (storedMap !== map) setMap(map);
10
11  return <></>;
12};
13
14export default MapController;