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

Fix crash when unmounting WrappedComponent #2407

Closed
wants to merge 1 commit into from

Conversation

wsxyeah
Copy link
Contributor

@wsxyeah wsxyeah commented Sep 20, 2017

Check if has routeName to prevent crash

Check if has routeName to prevent crash
@mcabs3
Copy link
Collaborator

mcabs3 commented Sep 23, 2017

Do you have an example of what would cause this crash?

@wsxyeah
Copy link
Contributor Author

wsxyeah commented Sep 23, 2017

@mcabs3 Yes.

Add a key for the container in Example.js (just like the LightBox).
Then choose the RN menu Toggle Inspector on the device, you will see the crash.

<Router>
  <Modal>
    <LightBox key="lightbox_top"> // here
      <Stack key="root"/>
      // other scenes …
    </LightBox>
  </Modal>
</Router>

@wsxyeah
Copy link
Contributor Author

wsxyeah commented Sep 24, 2017

@mcabs3 Oh, I found the root cause now.

Sine the OverlayNavigator passed wrong state to its child overlay components, the children will never get this.props.navigation.state.routeName.

@mcabs3
Copy link
Collaborator

mcabs3 commented Sep 30, 2017

@wsxyeah so is this change irrelevant now?

@wsxyeah wsxyeah closed this Oct 4, 2017
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

Successfully merging this pull request may close these issues.

2 participants