JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet/v1.0.0-rc.1/leaflet.css">
<script src="http://cdn.leafletjs.com/leaflet/v1.0.0-rc.1/leaflet.js"></script>
<div id="map"></div>
CSS
#map {
height: 500px;
}
JavaScript
var map = L.map("map");
L.tileLayer("http://{s}.tile.osm.org/{z}/{x}/{y}.png").addTo(map);
map.setView([48.85, 2.35], 12);
var marker, popupContent;
for (var i = 0; i < 1; i += 1) {
marker = L.marker([48.85, 2.35]).addTo(map);
popupContent = document.createElement("img");
popupContent.onload = function () {
marker.openPopup();
};
popupContent.src = "http://c4.staticflickr.com/1/691/21131215939_49601d06ef_b.jpg";
//popupContent = '<img src="http://c4.staticflickr.com/1/691/21131215939_49601d06ef_b.jpg" />';
marker.bindPopup(popupContent, {
maxWidth: "auto"
});
}
marker.openPopup();