Fixed SwitchNavigatorConfig interface to use the correct backBehavior value for initialRoute. And added a test to cover this. (#25533)

This commit is contained in:
yamiscott
2018-05-04 15:53:47 -07:00
committed by Andy
parent 19a7bc6ebd
commit a2a2edb657
2 changed files with 21 additions and 1 deletions
+1 -1
View File
@@ -631,7 +631,7 @@ export interface SwitchNavigatorConfig {
initialRouteName: string;
resetOnBlur?: boolean;
paths?: NavigationPathsConfig;
backBehavior?: 'none' | 'intialRoute';
backBehavior?: 'none' | 'initialRoute';
}
// Return createNavigationContainer
@@ -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 (
<SwitchNavigatorWithInitialRoute
ref={(ref: any) => { }}
style={viewStyle}
/>
);
}
/**
* Drawer navigator.
*/