mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-23 04:00:15 +08:00
feat: use modal presentation style for modals on iOS by default
This commit is contained in:
@@ -6,7 +6,6 @@ import {
|
||||
createStackNavigator,
|
||||
StackScreenProps,
|
||||
StackNavigationOptions,
|
||||
TransitionPresets,
|
||||
} from '@react-navigation/stack';
|
||||
import Article from '../Shared/Article';
|
||||
import Albums from '../Shared/Albums';
|
||||
@@ -88,17 +87,17 @@ export default function SimpleStackScreen({ navigation, options }: Props) {
|
||||
return (
|
||||
<ModalPresentationStack.Navigator
|
||||
mode="modal"
|
||||
screenOptions={({ route, navigation }) => ({
|
||||
...TransitionPresets.ModalPresentationIOS,
|
||||
cardOverlayEnabled: true,
|
||||
gestureEnabled: true,
|
||||
headerStatusBarHeight:
|
||||
navigation
|
||||
.dangerouslyGetState()
|
||||
.routes.findIndex((r: any) => r.key === route.key) > 0
|
||||
? 0
|
||||
: undefined,
|
||||
})}
|
||||
// screenOptions={({ route, navigation }) => ({
|
||||
// ...TransitionPresets.ModalPresentationIOS,
|
||||
// cardOverlayEnabled: true,
|
||||
// gestureEnabled: true,
|
||||
// headerStatusBarHeight:
|
||||
// navigation
|
||||
// .dangerouslyGetState()
|
||||
// .routes.findIndex((r: any) => r.key === route.key) > 0
|
||||
// ? 0
|
||||
// : undefined,
|
||||
// })}
|
||||
{...options}
|
||||
>
|
||||
<ModalPresentationStack.Screen
|
||||
|
||||
Reference in New Issue
Block a user