Test Failed
Pull Request — development (#78)
by Vad
09:56
created

MapCenter.tsx ➔ MapCenter   A

Complexity

Conditions 1

Size

Total Lines 9
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 9
dl 0
loc 9
rs 9.95
c 0
b 0
f 0
1
import { useMap } from 'react-leaflet';
2
import { LatLngExpression } from 'leaflet';
3
import { useEffect } from 'react';
4
5
export default function MapCenter({ center, zoom }: { center: LatLngExpression; zoom: number }) {
6
    const map = useMap();
7
8
    useEffect(() => {
9
        map.setView(center, zoom);
10
    }, [center, zoom, map]);
11
12
    return null;
13
}
14