Skip to content

Commit cef7a66

Browse files
committed
Update custom navigator section in upgrade guide
1 parent df3cb49 commit cef7a66

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

versioned_docs/version-7.x/upgrading-from-6.x.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -471,26 +471,24 @@ Custom navigators now require more type information to work correctly so that we
471471
- typeof MyNavigator
472472
- >(MyNavigator);
473473
+ export function createMyNavigator<
474-
+ ParamList extends ParamListBase,
475-
+ NavigatorID extends string | undefined = undefined,
476-
+ TypeBag extends NavigatorTypeBagBase = {
474+
+ const ParamList extends ParamListBase,
475+
+ const NavigatorID extends string | undefined = undefined,
476+
+ const TypeBag extends NavigatorTypeBagBase = {
477477
+ ParamList: ParamList;
478478
+ NavigatorID: NavigatorID;
479-
+ State: MyNavigationState<ParamList>;
480-
+ ScreenOptions: MyNavigationOptions;
481-
+ EventMap: MyNavigationEventMap;
479+
+ State: TabNavigationState<ParamList>;
480+
+ ScreenOptions: TabNavigationOptions;
481+
+ EventMap: TabNavigationEventMap;
482482
+ NavigationList: {
483-
+ [RouteName in keyof ParamList]: MyNavigationProp<
483+
+ [RouteName in keyof ParamList]: TabNavigationProp<
484484
+ ParamList,
485485
+ RouteName,
486486
+ NavigatorID
487487
+ >;
488488
+ };
489-
+ Navigator: typeof MyNavigator;
489+
+ Navigator: typeof TabNavigator;
490490
+ },
491-
+ Config extends StaticConfig<TypeBag> | undefined =
492-
+ | StaticConfig<TypeBag>
493-
+ | undefined,
491+
+ const Config extends StaticConfig<TypeBag> = StaticConfig<TypeBag>,
494492
+ >(config?: Config): TypedNavigator<TypeBag, Config> {
495493
+ return createNavigatorFactory(MyNavigator)(config);
496494
+ }

0 commit comments

Comments
 (0)