JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://cdn.leafletjs.com/leaflet-0.5/leaflet.js"></script>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.5/leaflet.css">
<!DOCTYPE html>
<body>
<div id="map" style="height: 300px"></div>
</body>
JavaScript
var map = L.map('map', { center: [51.505, -0.09], zoom: 13 });
osm = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {});
map.addLayer(osm);
function initMap() {
$('#map').css({"height": $(window).height() + "px"});
map.setView(map.getCenter());
}
var id;
$(window).resize(function() {
clearTimeout(id);
id = setTimeout(initMap, 500);
});
initMap();