react-native-arcgis-mapview icon indicating copy to clipboard operation
react-native-arcgis-mapview copied to clipboard

App Crashes when map view is unmounted.

Open OsamaMukhtar opened this issue 4 years ago • 3 comments

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>
  );
}

Simulator Screen Shot - iPhone X - 2020-06-19 at 15 31 12

OsamaMukhtar avatar Jun 19 '20 10:06 OsamaMukhtar

This is where it crashes:

componentWillUnmount() {
    UIManager.dispatchViewManagerCommand(
      findNodeHandle(this.agsMapRef),
      UIManager.getViewManagerConfig('RNArcGISMapView').Commands.dispose,
      [args]
    );
  }

OsamaMukhtar avatar Jun 19 '20 10:06 OsamaMukhtar

This is where it crashes:

componentWillUnmount() {
    UIManager.dispatchViewManagerCommand(
      findNodeHandle(this.agsMapRef),
      UIManager.getViewManagerConfig('RNArcGISMapView').Commands.dispose,
      [args]
    );
  }

Can you solve it?

Ma2iio avatar Aug 02 '20 15:08 Ma2iio

@OsamaMukhtar You can remove "args" and using patch-package for another developer.

Ma2iio avatar Aug 02 '20 15:08 Ma2iio