mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-01-12 22:51:18 +08:00
refactor: tweak the types
This commit is contained in:
@@ -46,7 +46,7 @@ export type StackNavigationHelpers = NavigationHelpers<
|
||||
|
||||
export type StackNavigationProp<
|
||||
ParamList extends ParamListBase,
|
||||
RouteName extends keyof ParamList = string
|
||||
RouteName extends keyof ParamList = keyof ParamList
|
||||
> = NavigationProp<
|
||||
ParamList,
|
||||
RouteName,
|
||||
@@ -58,7 +58,7 @@ export type StackNavigationProp<
|
||||
|
||||
export type StackScreenProps<
|
||||
ParamList extends ParamListBase,
|
||||
RouteName extends keyof ParamList = string
|
||||
RouteName extends keyof ParamList = keyof ParamList
|
||||
> = {
|
||||
navigation: StackNavigationProp<ParamList, RouteName>;
|
||||
route: RouteProp<ParamList, RouteName>;
|
||||
@@ -182,7 +182,7 @@ export type StackHeaderProps = {
|
||||
export type StackDescriptor = Descriptor<
|
||||
StackNavigationOptions,
|
||||
StackNavigationProp<ParamListBase>,
|
||||
RouteProp<ParamListBase, string>
|
||||
RouteProp<ParamListBase>
|
||||
>;
|
||||
|
||||
export type StackDescriptorMap = Record<string, StackDescriptor>;
|
||||
|
||||
Reference in New Issue
Block a user