Skip to content

Commit 95db5c4

Browse files
authored
Merge pull request #4 from St1ggy/master
Update pop function with return destination route
2 parents a15437b + 951d1aa commit 95db5c4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,13 @@ export const makeNavigation = (navigationRouteName: string) => ({
6565
pop: () => {
6666
const navigator = navigators[navigationRouteName];
6767
if (navigator) {
68+
const { routes, index } = navigator.state.nav;
69+
const offset = index >= 1 ? 1 : 0;
70+
const route = routes[index - offset];
6871
navigator._navigation.pop();
72+
return route.routeName;
6973
}
74+
return null;
7075
},
7176
reset: (routeName?: string | string[], params?: Object) => {
7277
const navigator = navigators[navigationRouteName];

0 commit comments

Comments
 (0)