Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App Crashes when map view is unmounted. #11

Open
OsamaMukhtar opened this issue Jun 19, 2020 · 3 comments
Open

App Crashes when map view is unmounted. #11

OsamaMukhtar opened this issue Jun 19, 2020 · 3 comments

Comments

@OsamaMukhtar
Copy link

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
Copy link
Author

This is where it crashes:

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

@Ma2iio
Copy link

Ma2iio commented Aug 2, 2020

This is where it crashes:

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

Can you solve it?

@Ma2iio
Copy link

Ma2iio commented Aug 2, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants