fix: implement canGoBack for tab router (#51)

This commit is contained in:
Satyajit Sahoo
2019-08-14 01:40:04 +05:30
committed by Michał Osadnik
parent 81348959ee
commit 2b8f2edfd1
2 changed files with 4 additions and 4 deletions

View File

@@ -69,10 +69,6 @@ const BaseRouter = {
shouldActionChangeFocus(action: CommonAction) {
return action.type === 'NAVIGATE';
},
canGoBack() {
return false;
},
};
export default BaseRouter;

View File

@@ -211,6 +211,10 @@ export default function TabRouter({
return action.type === 'NAVIGATE';
},
canGoBack(state) {
return router.getStateForAction(state, { type: 'GO_BACK' }) !== null;
},
actionCreators: TabActions,
};