mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-30 13:22:13 +08:00
fix: close drawer on back button press
This commit is contained in:
@@ -152,6 +152,16 @@ export default function DrawerRouter(
|
||||
action
|
||||
);
|
||||
|
||||
case 'GO_BACK':
|
||||
if (state.isDrawerOpen) {
|
||||
return {
|
||||
...state,
|
||||
isDrawerOpen: false,
|
||||
};
|
||||
}
|
||||
|
||||
return router.getStateForAction(state, action);
|
||||
|
||||
default:
|
||||
return router.getStateForAction(state, action);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user