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: unmounting modals with navigation #315

Merged
merged 5 commits into from
Mar 4, 2021

Conversation

gorhom
Copy link
Owner

@gorhom gorhom commented Mar 2, 2021

Resolves #292 #299

Motivation

to provide better handling when unmounting modals due to navigation changes

Installation

yarn add ssh://git@github.com:gorhom/react-native-bottom-sheet#fix/unmounting-modals-with-navigation

@gorhom gorhom added the v3 Written in Reanimated v2 label Mar 2, 2021
@gorhom
Copy link
Owner Author

gorhom commented Mar 2, 2021

@chybisov & @ksitko could you test this pr, thanks :)

@ksitko
Copy link

ksitko commented Mar 3, 2021

@gorhom The pr resolves the crash :)
I seem to be getting a state update on an unmounted component warning though:

Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.

@chybisov Are you getting the same or is this just me?

@gorhom
Copy link
Owner Author

gorhom commented Mar 3, 2021

@ksitko thanks for testing it and reporting this warning, i'll look into it shortly

@gorhom
Copy link
Owner Author

gorhom commented Mar 3, 2021

@ksitko i have pushed a commit that will prevent state update when modal is not mounted 👍

@ksitko
Copy link

ksitko commented Mar 3, 2021

@gorhom Nice! I can confirm that latest commit fixed the warning. I found a different problem. When not in dev mode I'm getting a crash on opening a bottom model sheet with a "TypeError Attempted to assign to readonly property" error message.

@gorhom
Copy link
Owner Author

gorhom commented Mar 4, 2021

@ksitko thanks for pointing this issue out, it was with the new release of portal, i have fixed this now on both repos.

would you mind testing the latest commit, thanks :)

@ksitko
Copy link

ksitko commented Mar 4, 2021

@gorhom Latest commit looks good. Thanks for the speedy fixes! :D

@gorhom gorhom merged commit 35ffee4 into v3 Mar 4, 2021
@gorhom gorhom deleted the fix/unmounting-modals-with-navigation branch March 4, 2021 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v3 Written in Reanimated v2
Projects
None yet
2 participants