A problem used to occur on RN old architecture: when the native RNOmhMapsMarkerNativeComponent would have to be unmounted, the new RN architecture would first unmount its children (removeViewAt in RNOmhMapsCoreViewManager.kt) and then the map fragment, however the old architecture apparently would first unmount the fragment and then the children, causing us to call remove() from OmhMapEntity's unmountEntity on a non-existent map. This in turn would result in a NullPointerException.
This PR introduces a simple fix that makes RNOmhMapsCoreViewManagerImpl check if the map fragment is currently mounted in removeViewAt before performing any operations. This ensures proper behaviour on old RN architecture.
Demo
N/A
Checklist:
[x] Documentation is up to date to reflect these changes
Summary
A problem used to occur on RN old architecture: when the native
RNOmhMapsMarkerNativeComponent
would have to be unmounted, the new RN architecture would first unmount its children (removeViewAt
inRNOmhMapsCoreViewManager.kt
) and then the map fragment, however the old architecture apparently would first unmount the fragment and then the children, causing us to callremove()
fromOmhMapEntity
'sunmountEntity
on a non-existent map. This in turn would result in aNullPointerException
.This PR introduces a simple fix that makes
RNOmhMapsCoreViewManagerImpl
check if the map fragment is currently mounted inremoveViewAt
before performing any operations. This ensures proper behaviour on old RN architecture.Demo
N/A
Checklist: