Closed iqbalhassan-7654 closed 1 month ago
I think this may happen when you access native leaflet methods at the time when map container is unmounted.
For example I'm attempting to store map bounds in a state when user navigates to another page. At the same time I'm unmounting map container
@piotr-cz How are you unmounting the map container? I am getting a similar issue as in this bug report; I try to use the remove() method on the map instance (when using the useMap hook) in a hook cleanup effect, but get a [Map container is already initialized] error.
@marcoangelo Now I'm using external state, so it's updates don't trigger leaflet methods after component has been unmounted
Bug report in v4
Before opening an issue, make sure to read the contributing guide and understand this is a bug tracker, not a support platform.
Please make sure to check the following boxes before submitting an issue.\ Issues opened without using this template will be closed unless they have a good reason not to follow this template.
Expected behavior
Please describe.
Actual behavior
Please describe.
Steps to reproduce
Please provide the simplest example possible to reproduce the issue, based on this StackBlitz.