Parent screen goes blank after dismissing a modal screen
See original GitHub issueI use both card and modal modes of react-navigation’s StackNavigator, as the following structure:
const CardNavigatorData = {
'Home': {
screen: HomeScreen,
},
'Content': {
screen: ContentScreen,
},
}
const CardNavigator = createStackNavigator(CardNavigatorData, {
initialRouteName: 'Home',
mode: 'card',
})
const RootNavigatorData = {
auth: {
screen: createStackNavigator(
{
modalRoot: {
screen: AuthScreen,
},
},,
},
cards: {
screen: CardNavigator,
},
}
const RootNavigator = createStackNavigator(RootNavigatorData, {
headerMode: 'none',
initialRouteName: 'cards',
mode: 'modal',
})
const RootNavigatorContainer = createAppContainer(RootNavigator)
Nesting these two modes so I can show an Auth modal anywhere inside CardNavigator stacks.
After upgrading to react-native-screens 2.0 version, when I dismiss a modal, like Home -> Push Content -> Show Auth -> Dismiss Auth, then go back from Content to Home, the Home screen goes blank.
Without calling enableScreens
everything works well.
Platform: Android react-native: 0.61.5 react-navigation: 4.0.10 react-native-screens: 2.0.0-alpha.13 react-navigation-stack: 1.10.3
Issue Analytics
- State:
- Created 4 years ago
- Reactions:12
- Comments:45 (12 by maintainers)
Top Results From Across the Web
Black Screen After Dismissing Modal Controller
Via the iPhone 6 simulator(split view is always collapsed) I present a modal viewcontroller with the following code: UINavigationController * ...
Read more >Black screen after presenting modal view controller in current ...
Dismissing the modal leaves the presenting view controller with it's view still removed from the window. Going to tab 2 and returning adds...
Read more >close the modal form and return to the Parent page ... - MSDN
I have a parent page and there are some text boxes on it، A modal window will open by pressing a button (id="btnprs")...
Read more >react-native-modal - npm
An enhanced, animated, customizable React Native modal. The goal of react-native-modal is expanding the original React Native <Modal> ...
Read more >Best Practices For Modal Window Design | by Nick Babich
A modal is a window that appears on top of a parent screen. It's called 'modal' because it creates a mode that disables...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@kmagiera I’ve created a repro-project here: https://github.com/cbrevik/blankmodal
This is using:
For the problem we experienced in our app, the bug seems to be related to the modal screen also wrapping a Stack-
Navigator
, and the screen navigating to the modal is also wrapped in its own nestedNavigator
. It doesn’t seem to matter if the nestedNavigator
is of type Stack or Bottom Tabs.I’m having the same issue, but only on Android. If I comment the following line, the error stops
Edit The error occurs on version
2.0.0-alpha.19
alsoEdit 2 Downgrading to
2.0.0-alpha.12
solved it for me. It seems the bug started on2.0.0-alpha.13
. Here are the versions that are working for me: