mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
Fixed SwitchNavigatorConfig interface to use the correct backBehavior value for initialRoute. And added a test to cover this. (#25533)
This commit is contained in:
Vendored
+1
-1
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user