I am trying to render custom react component in react-leaflet GeoJSON onEachFeature popup, e.g. to fire modal with all corresponding feature.properties. In a popup react-leaflet component it works great
<Popup>
Some text
<Another React Component />
</Popup>
But onEachFeature function for GeoJSON looks like this
onEachFeature(feature, layer) {
const popupContent = `
<div>
<p>${feature.properties.name}</p>
</div>
`;
layer.bindPopup(popupContent);
}
popupContent is a html code and I do not know how to include react component in it. Need help! Thank you!