Hi,
Got a lifecycle issue in my react application I can't seem to figure out. Hopefully someone can point me in the right direction.
Situation: I've got a React SPA which has a map on several components this is working fine on the initial rendering and while interacting on the given component. The issue occurs when navigating away from the component I'll get the following errors in the console:
After these errors have been thrown the map does not behave as intended for example the expand widget no longer loads:
Initial load:
Loading a map after the errors:
I can't seem to find anything in the documentation about the need to manually clean up any references or something so any help regarding this issue will be highly appreciated
Solved! Go to Solution.
If you had a github repro, would be easier to tell. One thing you can do is add the "autoDestroyDisabled" to your components. All the map components have it.
From the description:
If true, the component will not be destroyed automatically when it is disconnected from the document. This is useful when you want to move the component to a different place on the page, or temporary hide it. If this is set, make sure to call the `destroy` method when you are done to prevent memory leaks.
If you had a github repro, would be easier to tell. One thing you can do is add the "autoDestroyDisabled" to your components. All the map components have it.
From the description:
If true, the component will not be destroyed automatically when it is disconnected from the document. This is useful when you want to move the component to a different place on the page, or temporary hide it. If this is set, make sure to call the `destroy` method when you are done to prevent memory leaks.
Thanks! This solved the issue!