Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/drawer/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export { default as DrawerItem } from './views/DrawerItem';
export { default as DrawerItemList } from './views/DrawerItemList';
export { default as DrawerToggleButton } from './views/DrawerToggleButton';
export { default as DrawerView } from './views/DrawerView';
export { MaybeScreen, MaybeScreenContainer } from './views/ScreenFallback';

/**
* Utilities
Expand Down
6 changes: 6 additions & 0 deletions packages/routers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,15 @@
},
"devDependencies": {
"del-cli": "^5.0.0",
"react": "18.2.0",
"react-native": "0.71.8",
"react-native-builder-bob": "^0.20.4",
"typescript": "^4.9.4"
},
"peerDependencies": {
"react": "*",
"react-native": "*"
},
"react-native-builder-bob": {
"source": "src",
"output": "lib",
Expand Down
9 changes: 9 additions & 0 deletions packages/routers/src/DrawerRouter.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { nanoid } from 'nanoid/non-secure';
import { Platform } from 'react-native';

import TabRouter, {
TabActionHelpers,
Expand Down Expand Up @@ -231,6 +232,14 @@ export default function DrawerRouter({
}

case 'GO_BACK':
// On TV, if the drawer is open and the navigator receives a GO_BACK action it shouldn't close the drawer again
if (Platform.isTV) {
const nextState = isDrawerInHistory(state)
? removeDrawerFromHistory(state)
: state;
return router.getStateForAction(nextState, action, options);
}

if (isDrawerInHistory(state)) {
return removeDrawerFromHistory(state);
}
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5819,8 +5819,13 @@ __metadata:
dependencies:
del-cli: ^5.0.0
nanoid: ^3.1.23
react: 18.2.0
react-native: 0.71.8
react-native-builder-bob: ^0.20.4
typescript: ^4.9.4
peerDependencies:
react: "*"
react-native: "*"
languageName: unknown
linkType: soft

Expand Down