아래 코드로 실행후 zoom을 바꿀때마다 뒷배경에 잔상이 남습니다…
카카오 예제에 보면 zoom변경시 뒷배경이 깔리던데, 제 코드에 문제가 있는걸까요??
아래는 지도 컴포넌트입니다
const MapComponent = () => {
const [x, setX] = useState(33.450701);
const [y, setY] = useState(126.570667);
useEffect(() => {
const kakao = (window as any).kakao;
const container = document.getElementById("map");
const center = new kakao.maps.LatLng(x, y);
const options = {
center: center,
level: 3,
};
const map = new kakao.maps.Map(container, options);
return () => {};
}, [x, y]);
return <div id=“map” style={{ width: 800, height: 800 }}>;
};