Skip to content

Commit

Permalink
remove NonNullable to fix recursive infer
Browse files Browse the repository at this point in the history
  • Loading branch information
johankasperi committed Jun 19, 2023
1 parent 7d8b515 commit a30d94c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/core/src/types.tsx
Expand Up @@ -735,7 +735,7 @@ export type NavigatorScreenParams<ParamList extends {}> =
};
}[keyof ParamList];

export type PathConfig<ParamList extends {}> = {
export type PathConfig<ParamList = {}> = {
/**
* Path string to match against.
* e.g. `/users/:id` will match `/users/1` and extract `id` param as `1`.
Expand Down Expand Up @@ -781,10 +781,10 @@ export type PathConfig<ParamList extends {}> = {
initialRouteName?: keyof ParamList;
};

export type PathConfigMap<ParamList extends {}> = {
[RouteName in keyof ParamList]?: NonNullable<
ParamList[RouteName]
> extends NavigatorScreenParams<infer T>
export type PathConfigMap<ParamList = {}> = {
[RouteName in keyof ParamList]?: ParamList[RouteName] extends NavigatorScreenParams<
infer T
>
? string | PathConfig<T>
: string | Omit<PathConfig<{}>, 'screens' | 'initialRouteName'>;
};

0 comments on commit a30d94c

Please sign in to comment.