diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index db45006ef0..d5f9801b5d 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -631,7 +631,7 @@ export interface SwitchNavigatorConfig { initialRouteName: string; resetOnBlur?: boolean; paths?: NavigationPathsConfig; - backBehavior?: 'none' | 'intialRoute'; + backBehavior?: 'none' | 'initialRoute'; } // Return createNavigationContainer diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index fb6e72a623..6b8b5c99e8 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -288,6 +288,26 @@ function renderBasicSwitchNavigator(): JSX.Element { ); } +const switchNavigatorConfigWithInitialRoute: SwitchNavigatorConfig = { + initialRouteName: 'screen', + resetOnBlur: false, + backBehavior: 'initialRoute' +}; + +const SwitchNavigatorWithInitialRoute = SwitchNavigator( + routeConfigMap, + switchNavigatorConfigWithInitialRoute, +); + +function renderSwitchNavigatorWithInitialRoute(): JSX.Element { + return ( + { }} + style={viewStyle} + /> + ); +} + /** * Drawer navigator. */