Skip to content
This repository has been archived by the owner on Feb 8, 2020. It is now read-only.

Commit

Permalink
fix: implement canGoBack for tab router (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 authored and osdnk committed Aug 13, 2019
1 parent 8134895 commit 2b8f2ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 0 additions & 4 deletions packages/core/src/BaseRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ const BaseRouter = {
shouldActionChangeFocus(action: CommonAction) {
return action.type === 'NAVIGATE';
},

canGoBack() {
return false;
},
};

export default BaseRouter;
4 changes: 4 additions & 0 deletions packages/routers/src/TabRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@ export default function TabRouter({
return action.type === 'NAVIGATE';
},

canGoBack(state) {
return router.getStateForAction(state, { type: 'GO_BACK' }) !== null;
},

actionCreators: TabActions,
};

Expand Down

0 comments on commit 2b8f2ed

Please sign in to comment.