react-native-arcgis-mapview
react-native-arcgis-mapview copied to clipboard
App Crashes when map view is unmounted.
After successfully displaying map, when I press back the app crashes in the ComponentWillUnmount function of the mapView saying 'args' is undefined. Here is my code :
export default function MapScreen() {
const mapView = useRef();
return (
<SafeAreaView style={styles.containerStyle}>
<ArcGISMapView ref={mapView} style={{width: '100%', height: '100%'}}
initialMapCenter={[{latitude: 34.055561, longitude: -117.182602}]}
recenterIfGraphicTapped={true}
rotationEnabled={false}
mapBasemap={ { type: 'normal' } }
/>
</SafeAreaView>
);
}
This is where it crashes:
componentWillUnmount() {
UIManager.dispatchViewManagerCommand(
findNodeHandle(this.agsMapRef),
UIManager.getViewManagerConfig('RNArcGISMapView').Commands.dispose,
[args]
);
}
This is where it crashes:
componentWillUnmount() { UIManager.dispatchViewManagerCommand( findNodeHandle(this.agsMapRef), UIManager.getViewManagerConfig('RNArcGISMapView').Commands.dispose, [args] ); }
Can you solve it?
@OsamaMukhtar You can remove "args" and using patch-package for another developer.