Search code examples
reactjsleaflet

export 'withLeaflet' (imported as 'withLeaflet') was not found in 'react-leaflet'


I updated leaflet library to

"react-leaflet": "^4.2.1",
"react-leaflet-draw": "^0.20.4",
"react-leaflet-markercluster": "^3.0.0-rc1",
"react-leaflet-textpath": "^2.1.1",

and this issue occurs.

export 'withLeaflet' (imported as 'withLeaflet') was not found in 'react-leaflet' (possible exports: AttributionControl, Circle, CircleMarker, FeatureGroup, GeoJSON, ImageOverlay, LayerGroup, LayersControl, MapContainer, Marker, Pane, Polygon, Polyline, Popup, Rectangle, SVGOverlay, ScaleControl, TileLayer, Tooltip, VideoOverlay, WMSTileLayer, ZoomControl, useMap, useMapEvent, useMapEvents)


Solution

  • there is not component named withLeaflet in react-leaflet v4.2.1 or any v4, that is why it is giving that error. You have to mention more details, which version you were using before? because, it must be that old version which has the export of withLeaflet component.