|
1 | 1 | import type * as Styles from '@/styles' |
2 | | -import type {RootParamList as KBRootParamList} from '@/router-v2/route-params' |
3 | 2 | import type {NativeStackNavigationProp, NativeStackNavigationOptions} from '@react-navigation/native-stack' |
4 | | -import type {RouteProp} from '@react-navigation/native' |
| 3 | +import type {ParamListBase, RouteProp} from '@react-navigation/native' |
5 | 4 | import type {HeaderBackButtonProps} from '@react-navigation/elements' |
6 | 5 |
|
7 | | -export type GetOptionsParams<RouteName extends keyof KBRootParamList = keyof KBRootParamList> = { |
8 | | - navigation: NativeStackNavigationProp<KBRootParamList, RouteName> |
9 | | - route: RouteProp<KBRootParamList, RouteName> |
| 6 | +export type GetOptionsParams<RouteName extends string = string> = { |
| 7 | + navigation: NativeStackNavigationProp<ParamListBase, RouteName> |
| 8 | + route: RouteProp<ParamListBase, RouteName> |
10 | 9 | } |
11 | 10 |
|
12 | 11 | // Type for screen components that receive navigation props |
13 | | -export type ScreenProps<RouteName extends keyof KBRootParamList = keyof KBRootParamList> = { |
14 | | - navigation: NativeStackNavigationProp<KBRootParamList, RouteName> |
15 | | - route: RouteProp<KBRootParamList, RouteName> |
| 12 | +export type ScreenProps<RouteName extends string = string> = { |
| 13 | + navigation: NativeStackNavigationProp<ParamListBase, RouteName> |
| 14 | + route: RouteProp<ParamListBase, RouteName> |
16 | 15 | } |
17 | 16 |
|
18 | 17 | export type ScreenComponentProps = { |
19 | 18 | route: {params: any} |
20 | | - navigation: NativeStackNavigationProp<KBRootParamList> |
| 19 | + navigation: NativeStackNavigationProp<ParamListBase, string> |
21 | 20 | } |
22 | 21 | // Properties consumed by our layout functions (not React Navigation) |
23 | 22 | export type LayoutOptions = { |
|
0 commit comments