[native-stack] modals are only dismissible on iOS 13
See original GitHub issueIn a barebones project I can’t get a modal to dismiss on iOS 11 or 12.
import React from 'react';
import {NavigationContainer} from '@react-navigation/native';
import {createNativeStackNavigator} from 'react-native-screens/native-stack';
import {enableScreens} from 'react-native-screens';
enableScreens();
import Root from './Root';
import Modal from './Modal';
const Stack = createNativeStackNavigator();
const App = () => (
<NavigationContainer>
<Stack.Navigator screenOptions={{stackPresentation: 'modal'}}>
<Stack.Screen name="ROOT" component={Root} />
<Stack.Screen name="MODAL" component={Modal} />
</Stack.Navigator>
</NavigationContainer>
);
export default App;
When an action is fired from Modal to dismiss or navigate back to Root the screen seems to be unmounted based on the performance monitor.
before navigation.goBack()
or navigation.navigate('ROOT')
is called:
after navigation.goBack()
or navigation.navigate('ROOT')
is called:
It doesn’t animate away and loses all responsiveness.
Everything works fine in iOS 13. Any thoughts?
Issue Analytics
- State:
- Created 3 years ago
- Comments:21 (11 by maintainers)
Top Results From Across the Web
Disable the interactive dismissal of presented view controller
Since the iOS 13, UIViewController contains a new property called isModalInPresentation which must be set to true to prevent the interactive ...
Read more >Opening a modal - React Navigation
The modal behavior slides the screen in from the bottom and allows the user to swipe down from the top to dismiss it...
Read more >react-native-screens - npm
To take advantage of the native stack navigator primitive for React ... modal will use UIModalPresentationAutomatic on iOS 13 and later, ...
Read more >viewWillAppear and modalview | Apple Developer Forums
hi, with ios13 when i call dismiss of modalview not call viewWillAppear on ... a storyboard by checking the modal presentation style of...
Read more >createStackNavigator - React Navigation - Netlify
On iOS the stack navigator can also be configured to a modal style where screens ... If false , the on screen keyboard...
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
@WoLewicki I can confirm that #643 fixes the issue described above.
I think there may be two issues being discussed here:
When using react-screens’
createNativeStackNavigator
, on iOS devices below iOS13, modals are not dismissable. I believe this is what is being references in the first post in this issue.When using react-native-screens 2.4.0 and the
transparentCard
option on acreateStackNavigator
from react-navigation: after dismissing a modal, it immediately reappears and is not dismissable.No. 2 is solvable by using
createNativeStackNavigator
.I believe 1 should be fixed by https://github.com/software-mansion/react-native-screens/pull/441 , but I’ve tested it and this hasn’t fixed it for me.
I don’t suppose you’ve had any recent luck with this @alexichristakis ?