mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-02-11 22:33:32 +08:00
Pass through entire drawer config object to router
This commit is contained in:
committed by
satyajit.happy
parent
9fdd671e6d
commit
416047c109
@@ -49,30 +49,8 @@ const DefaultDrawerConfig = {
|
||||
|
||||
const DrawerNavigator = (routeConfigs, config = {}) => {
|
||||
const mergedConfig = { ...DefaultDrawerConfig, ...config };
|
||||
|
||||
const {
|
||||
order,
|
||||
paths,
|
||||
initialRouteName,
|
||||
initialRouteParams,
|
||||
backBehavior,
|
||||
getCustomActionCreators,
|
||||
...drawerConfig
|
||||
} = mergedConfig;
|
||||
|
||||
const routerConfig = {
|
||||
order,
|
||||
paths,
|
||||
initialRouteName,
|
||||
initialRouteParams,
|
||||
backBehavior,
|
||||
getCustomActionCreators,
|
||||
};
|
||||
|
||||
const drawerRouter = DrawerRouter(routeConfigs, routerConfig);
|
||||
|
||||
const navigator = createNavigator(DrawerView, drawerRouter, drawerConfig);
|
||||
|
||||
const drawerRouter = DrawerRouter(routeConfigs, mergedConfig);
|
||||
const navigator = createNavigator(DrawerView, drawerRouter, mergedConfig);
|
||||
return createNavigationContainer(navigator);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user