mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-24 04:25:34 +08:00
fix: change type of the navigation field in DrawerContentComponentProps (#121)
This commit is contained in:
@@ -3,7 +3,6 @@ import {
|
||||
NavigationState,
|
||||
NavigationRoute,
|
||||
NavigationParams,
|
||||
NavigationProp,
|
||||
NavigationDescriptor,
|
||||
SupportedThemes,
|
||||
NavigationScreenConfig,
|
||||
@@ -109,7 +108,7 @@ export type DrawerNavigatorItemsProps = {
|
||||
};
|
||||
|
||||
export type DrawerContentComponentProps = DrawerNavigatorItemsProps & {
|
||||
navigation: NavigationProp<NavigationDrawerState>;
|
||||
navigation: NavigationScreenProp<NavigationDrawerState>;
|
||||
descriptors: SceneDescriptorMap;
|
||||
drawerOpenProgress: Animated.Node<number>;
|
||||
screenProps: unknown;
|
||||
|
||||
@@ -3,7 +3,7 @@ import { StyleSheet, View, ViewStyle } from 'react-native';
|
||||
import {
|
||||
NavigationActions,
|
||||
NavigationRoute,
|
||||
NavigationProp,
|
||||
NavigationScreenProp,
|
||||
} from 'react-navigation';
|
||||
import Animated from 'react-native-reanimated';
|
||||
import {
|
||||
@@ -17,7 +17,7 @@ type Props = {
|
||||
contentComponent?: React.ComponentType<DrawerContentComponentProps>;
|
||||
contentOptions?: object;
|
||||
screenProps?: unknown;
|
||||
navigation: NavigationProp<NavigationDrawerState>;
|
||||
navigation: NavigationScreenProp<NavigationDrawerState>;
|
||||
descriptors: SceneDescriptorMap;
|
||||
drawerOpenProgress: Animated.Node<number>;
|
||||
drawerPosition: 'left' | 'right';
|
||||
@@ -73,7 +73,6 @@ class DrawerSidebar extends React.PureComponent<Props> {
|
||||
focused: boolean;
|
||||
}) => {
|
||||
if (focused) {
|
||||
// @ts-ignore
|
||||
this.props.navigation.closeDrawer();
|
||||
} else {
|
||||
this.props.navigation.dispatch(
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
SceneView,
|
||||
ThemeColors,
|
||||
ThemeContext,
|
||||
NavigationProp,
|
||||
NavigationScreenProp,
|
||||
} from 'react-navigation';
|
||||
import { ScreenContainer } from 'react-native-screens';
|
||||
|
||||
@@ -41,7 +41,7 @@ type DrawerOptions = {
|
||||
|
||||
type Props = {
|
||||
lazy: boolean;
|
||||
navigation: NavigationProp<NavigationDrawerState>;
|
||||
navigation: NavigationScreenProp<NavigationDrawerState>;
|
||||
descriptors: SceneDescriptorMap;
|
||||
navigationConfig: DrawerOptions & {
|
||||
contentComponent?: React.ComponentType<DrawerContentComponentProps>;
|
||||
|
||||
Reference in New Issue
Block a user