fixed error in react-navigation preventing declaring navigationOptions as a function (#23879)

This commit is contained in:
Steven
2018-02-26 13:35:23 -08:00
committed by Andy
parent be4f000209
commit ce73af4e00
2 changed files with 21 additions and 0 deletions

View File

@@ -13,6 +13,7 @@
// Sergei Butko: <https://github.com/svbutko>
// Veit Lehmann: <https://github.com/levito>
// Roberto Huertas: <https://github.com/robertohuertasm>
// Steven Miller <https://github.com/YourGamesBeOver>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.6

View File

@@ -199,6 +199,26 @@ function renderBasicStackNavigator(): JSX.Element {
);
}
const stackNavigatorConfigWithNavigationOptionsAsFunction: StackNavigatorConfig = {
mode: "card",
headerMode: "screen",
navigationOptions: ({navigationOptions, navigation, screenProps}) => (stackNavigatorScreenOptions),
};
const AdvancedStackNavigator = StackNavigator(
routeConfigMap,
stackNavigatorConfigWithNavigationOptionsAsFunction
);
function renderAdvancedStackNavigator(): JSX.Element {
return (
<AdvancedStackNavigator
ref={(ref: any) => { }}
style={viewStyle}
/>
);
}
/**
* Drawer navigator.
*/