Skip to content

Commit

Permalink
Update types.tsx
Browse files Browse the repository at this point in the history
making NativeStackHeaderProps type generic
  • Loading branch information
nikmantulenko committed Mar 15, 2023
1 parent 4163cba commit e0356b1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/native-stack/src/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ export type NativeStackNavigationHelpers = NavigationHelpers<
// We want it to be an empty object because navigator does not have any additional props
export type NativeStackNavigationConfig = {};

export type NativeStackHeaderProps = {
export type NativeStackHeaderProps<
ParamList extends ParamListBase,
RouteName extends keyof ParamList = string,
> = {
/**
* Options for the back button.
*/
Expand All @@ -81,11 +84,11 @@ export type NativeStackHeaderProps = {
/**
* Route object for the current screen.
*/
route: Route<string>;
route: RouteProp<ParamList, RouteName>;
/**
* Navigation prop for the header.
*/
navigation: NativeStackNavigationProp<ParamListBase>;
navigation: NativeStackNavigationProp<ParamList, RouteName>;
};

export type HeaderButtonProps = {
Expand Down

0 comments on commit e0356b1

Please sign in to comment.