mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-03-06 17:34:59 +08:00
fix: implement canGoBack for tab router (#51)
This commit is contained in:
committed by
Michał Osadnik
parent
81348959ee
commit
2b8f2edfd1
@@ -69,10 +69,6 @@ const BaseRouter = {
|
||||
shouldActionChangeFocus(action: CommonAction) {
|
||||
return action.type === 'NAVIGATE';
|
||||
},
|
||||
|
||||
canGoBack() {
|
||||
return false;
|
||||
},
|
||||
};
|
||||
|
||||
export default BaseRouter;
|
||||
|
||||
@@ -211,6 +211,10 @@ export default function TabRouter({
|
||||
return action.type === 'NAVIGATE';
|
||||
},
|
||||
|
||||
canGoBack(state) {
|
||||
return router.getStateForAction(state, { type: 'GO_BACK' }) !== null;
|
||||
},
|
||||
|
||||
actionCreators: TabActions,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user