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: cleanup modal backhandler listener on unmount #3049

Merged
merged 2 commits into from
Jan 26, 2022

Conversation

dgruseck
Copy link
Contributor

Summary

If a modal is getting unmounted and the visible prop is not changed to false beforehand, the hardwareBackPress listener is not getting removed.
This bug was introduced in version 3.10.0, when the change to the functional component happened (#2557).

Test plan

  1. Show the modal
  2. Unmount component
  3. The hardwareBackPress is still listening, you can add another hardwareBackPress listener in your parent component to see if it is getting called.

@callstack-bot
Copy link

callstack-bot commented Jan 26, 2022

Hey @dgruseck, thank you for your pull request 🤗. The documentation from this branch can be viewed here.

Copy link
Member

@lukewalczak lukewalczak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

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.

3 participants