@vinctus/react-maplibre 1.3.1 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/Layer.js +3 -1
  2. package/package.json +1 -1
package/dist/Layer.js CHANGED
@@ -80,7 +80,9 @@ export const Layer = ({ layer, source }) => {
80
80
  }, [id, layerStructureString, sourceOptionsString, map, mapLoaded]);
81
81
  useEffect(() => {
82
82
  const current = applied.current;
83
- if (!map || !mapLoaded || !current) {
83
+ // A replaced map is removed before the context hands out the new one, so this effect can run
84
+ // once more against the removed map.
85
+ if (!map || !mapLoaded || !current || map._removed) {
84
86
  return;
85
87
  }
86
88
  // The source disappears when the map's style is replaced, so the source and layer are rebuilt
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vinctus/react-maplibre",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "Minimalist MapLibre GL JS React wrapper library",
5
5
  "type": "module",
6
6
  "types": "dist/index.d.ts",