react-native-screens: presentation="modal" not working on android
Description
Having set presentation="modal"
for a screen has no effect on that screen on Android (still opens full screen view)
<Stack.Screen name="ComponentName" component={Component} options={() => ({
presentation: 'modal'
})} />
Works as expected on iOS.
Steps to reproduce
- Add
presentation="modal"
to a screenoptions
- See that it has no effect on android (still opens the full screen view) - see the snack attached
Snack or a link to a repository
https://snack.expo.dev/gg56CATOS
Screens version
6.6.1
React Native version
0.69.0
Platforms
Android
JavaScript runtime
Hermes
Workflow
React Native (without Expo)
Architecture
Paper (Old Architecture)
Build type
No response
Device
No response
Device model
No response
Acknowledgements
Yes
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 2
- Comments: 54 (1 by maintainers)
let’s change to use flutter.
Hi, sorry for late response!
There is likely no workaround, because as @jaredly reported, indeed Android modal view are effectively not implemented. I recently started looking into it while attempting to implement bottom-sheets for Android – and unfortunately there are some technical reasons why it is the case and Android modals were left behind. It looks that documentation is indeed misleading, sorry! Once I’ll open PR with support for modals & I’ll try to remember to link it here so you can track progress.
use import {createStackNavigator} from “@react-navigation/stack”; instead of import {createNativeStackNavigator} from “@react-navigation/native-stack”; working for both Android and IOS
after upgrading to react navigation V6 this code worked for me:
add the below in screenOptions : animation:“slide_from_bottom”
6 months and the docs still say this presentation works on android and ios. Would appreciate any update 😃
working perfectly
Changing from
modal
totransparentModal
worked for me. @Paulods0 @izyspaniafinally this is worked
`import { TransitionPresets } from ‘@react-navigation/stack’;
<Stack.Screen name=“Profile” component={Profile} options={{ title: ‘Profile’, …TransitionPresets.ModalSlideFromBottomIOS, }} />;`
The currently available transitions are:
<Stack.Group screenOptions={{ presentation: ‘modal’,animation:“slide_from_bottom” }}> <Stack.Screen name=“Shopp” component={Panier} options={{ title: ’ Shopp’, presentation: ‘modal’, }} /> </Stack.Group>
Well over a year and still what most would call a key facility is non functional. What, do they all use iphones or what?
so with
"expo": "~50.0.5",
and"expo-router": "~3.4.6",
it’s still not working , shame because docs saying differentlyHey, I just found a temporary workaround for this for android, if you want modal to be a bit of away from screen like IOS version, just add these screen options and you are good to go.
presentation=modal is still not working for bot ios and android
any updates?
I am having the same issue, my app heavily relies on modal to work correctly. Is there any kind of communication regarding this being in the pipeline to be fixed?
Mine is working well not covering full screen. I am using createStackNavigator (non native) and screenOptions={{presentation: ‘modal’}} I created a separated group for modal presentations by using <“StackName”.Group screenOptions={{presentation: ‘modal’}}>, hope that works
Still an issue with “expo”: “~49.0.15”, “expo-router”: “^2.0.0” First time trying Expo, lots of cool features but been flaky for certain features
This is using the javascript look-alike implementation (
@react-navigation/stack
), and not the native implementation from@react-navigation/native-stack
I want to make the previous screen appear a little bit in the current screen