I have imported Leaflet module along with some code to delete the Icon.
import L from "leaflet";
import { Map, TileLayer, Marker, Popup } from "react-leaflet";
import "leaflet/dist/leaflet.css";
delete L.Icon.Default.prototype._getIconUrl;
L.Icon.Default.mergeOptions({
iconRetinaUrl: require("./images/marker-icon-2x.png"),
iconUrl: require("./images/marker-icon.png"),
shadowUrl: require("./images/marker-shadow.png"),
});
The Marker Icons reside in my image folder. I also tried requiring directly:
L.Icon.Default.mergeOptions({
iconRetinaUrl: require("leaflet/dist/images/marker-icon-2x.png"),
iconUrl: require("leaflet/dist/images/marker-icon.png"),
shadowUrl: require("leaflet/dist/images/marker-shadow.png"),
});
But still I get a broken marker.