-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
react-native modal components from my screens are still visible when navigating #3463
Comments
Can you please update to 1.0 let us know if it still happens? |
this most certainly happens on 1.0 as well. My advice would be to rely on react-navigation to present modal screens. |
you should use |
@brentvatne Thanks but that looks like a workaround to the issue. I can give another one if used with redux, that's looking to the last route in the "routes" array and check routeName. Both work, but I posted the issue here so it may be solved without workarounds. @kelset just tested on 1.0.0 to be sure, same issue. @vonovak Indeed, that's a good advice :) But, unfortunately, it's not the case here. I understand that react-navigation provides its own modal "system", but in my opinion it should really be indicated somewhere that it's not working well with this original react-native component. |
this is not a workaround. this is how you would do that. we don't integrate with react-native's built in modal and assume that you want to close it when you switch between screens, that's up to you |
that said, if you have a better idea for what we should do for this you are welcome to submit a RFC! https://github.com/react-navigation/rfcs |
Current Behavior
When using RN's modal component on my screens, when I navigate from one screen to another, all the modals stay visible (with stackNavigator).
see expo snack here or code below:
gif representing both modal stacked:
![modal_issue](https://user-images.githubusercontent.com/3595709/35925527-3aeed9fe-0c26-11e8-8ee4-616adb91e22e.gif)
Expected Behavior
Even if it's explained by the fact that screens are not unmounted when stacked, it should not display the modal from the underneath screen. Or at least it should be written somewhere that react-navigation does not work with react-native modals.
How to reproduce
See the link to the expo snack or code below:
Your Environment
The text was updated successfully, but these errors were encountered: