mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-03-27 22:56:07 +08:00
fix: fix types for stack config
This commit is contained in:
@@ -2,7 +2,12 @@ import { StackRouter, createNavigator } from '@react-navigation/core';
|
||||
import { createKeyboardAwareNavigator } from '@react-navigation/native';
|
||||
import { Platform } from 'react-native';
|
||||
import StackView from '../views/Stack/StackView';
|
||||
import { NavigationStackOptions, NavigationProp, Screen } from '../types';
|
||||
import {
|
||||
NavigationStackConfig,
|
||||
NavigationStackOptions,
|
||||
NavigationProp,
|
||||
Screen,
|
||||
} from '../types';
|
||||
|
||||
function createStackNavigator(
|
||||
routeConfigMap: {
|
||||
@@ -17,7 +22,7 @@ function createStackNavigator(
|
||||
}) => NavigationStackOptions);
|
||||
};
|
||||
},
|
||||
stackConfig: NavigationStackOptions = {}
|
||||
stackConfig: NavigationStackConfig = {}
|
||||
) {
|
||||
const router = StackRouter(routeConfigMap, stackConfig);
|
||||
|
||||
|
||||
@@ -107,14 +107,14 @@ export type NavigationStackOptions = HeaderOptions &
|
||||
vertical?: number;
|
||||
horizontal?: number;
|
||||
};
|
||||
disableKeyboardHandling?: boolean;
|
||||
onTransitionStart?: () => void;
|
||||
onTransitionEnd?: () => void;
|
||||
};
|
||||
|
||||
export type NavigationConfig = {
|
||||
mode: 'card' | 'modal';
|
||||
headerMode: HeaderMode;
|
||||
export type NavigationStackConfig = {
|
||||
mode?: 'card' | 'modal';
|
||||
headerMode?: HeaderMode;
|
||||
disableKeyboardHandling?: boolean;
|
||||
};
|
||||
|
||||
export type SceneDescriptor = {
|
||||
|
||||
@@ -7,7 +7,7 @@ import HeaderContainer, {
|
||||
} from '../Header/HeaderContainer';
|
||||
import {
|
||||
NavigationProp,
|
||||
NavigationConfig,
|
||||
NavigationStackConfig,
|
||||
Route,
|
||||
SceneDescriptorMap,
|
||||
} from '../../types';
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
type Props = {
|
||||
navigation: NavigationProp;
|
||||
descriptors: SceneDescriptorMap;
|
||||
navigationConfig: NavigationConfig;
|
||||
navigationConfig: NavigationStackConfig;
|
||||
onTransitionStart?: (
|
||||
current: { index: number },
|
||||
previous: { index: number }
|
||||
|
||||
Reference in New Issue
Block a user