Closed sandeepsinghs closed 6 years ago
onTabChange
has as parameter the tab object, not only the tab key. You can get the key with
onTabChange = newTab => {
console.log(newTab.key)
}
It seems like the documentation is wrong about that. I'm going to fix that.
Sorry, of course it's onTabPress
, not onTabChange
.
Thank you @timomeh
I need one more help please.
After knowing pressed name of tab I need to replace the above View of BottomNavigation to other specific view act as navigating to multiple view on clicks of tab.
I am beginner for react native. Please help.
I updated the wrong docs, thus I'm going to close this issue. Thank you for pointing this out.
After knowing pressed name of tab I need to replace the above View of BottomNavigation to other specific view act as navigating to multiple view on clicks of tab.
For this case you need a Navigation Library, such as react-navigation or react-native-navigation. Navigating is not a part of react-native-material-bottom-navigation.
While selecting specific tab from bottom navigation bar and trying to log the name of selected tab then getting as [object Object].
I want to know the selected tab so that I can navigate to specific screen.
Please help.