Skip to content

Commit

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

Fix removing the map handlers when `MapContainer` is unmounted.

## v3.2.3 (2022-01-08)

- Fix tooltip position ([PR #939](https://github.com/PaulLeCam/react-leaflet/pull/939) by [simonasdev](https://github.com/simonasdev)).
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.3",
"version": "3.2.4",
"description": "React components for Leaflet maps",
"main": "cjs/index.js",
"module": "esm/index.js",
Expand Down
4 changes: 4 additions & 0 deletions packages/react-leaflet/src/MapContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ export function MapContainer<
createdRef.current = true
whenCreated(map)
}

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

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

0 comments on commit 9f88d11

Please sign in to comment.