I'm using react-native-navigation(wix) and I have 4 root tabs in my app. I'd like to navigate back to my previous tabs when I go from one tab to another.
Asked
Active
Viewed 757 times
0
-
have you checked out the `push` and `pop` methods for the navigator – warl0ck Apr 12 '18 at 10:43
-
1you can store tabs index in variable like `currentTabIndex = 2` and then: `navigator.switchToTab({ tabIndex: currentTabIndex });` – Ivan Chernykh Apr 12 '18 at 11:16
-
Could you show a code snippet about this approach? Sorry, I'm new to react-native... – Alan D'monte Apr 16 '18 at 09:33
1 Answers
1
This is Cherniv's answer. But basically what' he's saying is that every tab has an index. From 0 to N.
So by doing this will achieve it.
this.props.navigator.switchToTab({
tabIndex: desiredIndex
});
In the meantime, Kudos to him for helping me aswell. Thanks @Cherniv.

msqar
- 2,940
- 5
- 44
- 90