// Minimal reproduction of popup error // Steps: // 1. Toggle on popups // 2. Click marker to see popup // 3. Toggle off popups. Popup will disappear. // 4. Click marker and see empty popup. import React from 'react'; import { MapContainer, Marker, Popup, TileLayer } from 'react-leaflet'; export default { title: 'Popup Errors', component: Map, }; const position: [number, number] = [51.505, -0.09]; export const PopupError = () => { const [showPopup, setShowPopup] = React.useState(false); return ( <> {' '} (show: {showPopup ? 'true' : 'false'}) {showPopup && Hello, world} ); };