Skip to content

Commit

Permalink
v3.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulLeCam committed Jan 15, 2022
1 parent 9f88d11 commit ca1e765
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v3.2.5 (2022-01-15)

Fix supporting mutable `whenCreated` with unmounting `MapContainer`.

## v3.2.4 (2022-01-09)

Fix removing the map handlers when `MapContainer` is unmounted.
Expand Down
2 changes: 1 addition & 1 deletion packages/react-leaflet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-leaflet",
"version": "3.2.4",
"version": "3.2.5",
"description": "React components for Leaflet maps",
"main": "cjs/index.js",
"module": "esm/index.js",
Expand Down
4 changes: 3 additions & 1 deletion packages/react-leaflet/src/MapContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,13 @@ export function MapContainer<
createdRef.current = true
whenCreated(map)
}
}, [map, whenCreated])

useEffect(() => {
return () => {
map?.remove()
}
}, [map, whenCreated])
}, [map])

const [props] = useState({ className, id, style })
const context = useMemo(
Expand Down

0 comments on commit ca1e765

Please sign in to comment.