aboutsummaryrefslogtreecommitdiff
path: root/modern/src/map/MapPadding.js
blob: 1a4643a963e1fe09f3d6b8d293ef887cfbf2d866 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { useEffect } from 'react';

import { map } from './core/Map';

const MapPadding = ({
  top, right, bottom, left,
}) => {
  useEffect(() => {
    map.setPadding({
      top, right, bottom, left,
    });
    return () => map.setPadding({
      top: 0, right: 0, bottom: 0, left: 0,
    });
  }, [top, right, bottom, left]);

  return null;
};

export default MapPadding;