Pass through all stack config to router

This commit is contained in:
Brent Vatne 2018-10-11 12:03:40 -07:00
parent bc166f85ad
commit af7d3986a6
1 changed files with 2 additions and 21 deletions

View File

@ -6,30 +6,11 @@ import {
import StackView from '../views/StackView/StackView';
function createStackNavigator(routeConfigMap, stackConfig = {}) {
const {
initialRouteKey,
initialRouteName,
initialRouteParams,
paths,
navigationOptions,
disableKeyboardHandling,
getCustomActionCreators,
} = stackConfig;
const stackRouterConfig = {
initialRouteKey,
initialRouteName,
initialRouteParams,
paths,
navigationOptions,
getCustomActionCreators,
};
const router = StackRouter(routeConfigMap, stackRouterConfig);
const router = StackRouter(routeConfigMap, stackConfig);
// Create a navigator with StackView as the view
let Navigator = createNavigator(StackView, router, stackConfig);
if (!disableKeyboardHandling) {
if (!stackConfig.disableKeyboardHandling) {
Navigator = createKeyboardAwareNavigator(Navigator, stackConfig);
}