fix: improve types for route prop in screenOptions

This commit is contained in:
Satyajit Sahoo
2020-10-28 22:06:52 +01:00
parent 836ca4482e
commit d26bcc057e
2 changed files with 11 additions and 13 deletions

View File

@@ -116,12 +116,12 @@ export type ActionCreators<Action extends NavigationAction> = {
[key: string]: (...args: any) => Action;
};
export type DefaultRouterOptions = {
export type DefaultRouterOptions<RouteName extends string = string> = {
/**
* Name of the route to focus by on initial render.
* If not specified, usually the first route is used.
*/
initialRouteName?: string;
initialRouteName?: RouteName;
};
export type RouterFactory<