I am trying to use react leaflet however map could not be rendered correctly below is the code:
import {Marker, Popup, TileLayer} from "leaflet/dist/leaflet-src.esm";
import {render} from "@testing-library/react";
import {useCallback, useMemo, useRef, useState} from "react";
import 'leaflet/dist/leaflet.css';
const center = {
lat: 51.505,
lng: -0.09,
}
function MapContainer(props) {
return null;
}
render(
<MapContainer /*center={center} zoom={13} scrollWheelZoom={false}*/>
<TileLayer
attribution='© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
</MapContainer>,
)
export default MapContainer;
and below is map rendered incorrectly.
I tried to search but i am not getting through it