'How to add a button on the bottomTabNavigator rather than navigating to a screen in react native?
I am using react-navigation 6. my requirement is to add a signout button in the bottom tab, I have a bottomTabNavigator. So, I want to add that button on the bottom tabs so as soon as it is pressed the user is logged out. is there a way this can be done?
Solution 1:[1]
Sure, it can be done. I would recommend you to go through the official documentation of BottomTabsNavigator and try to find out a way on your own as it will help you to solve the problems in the future.
Hint Your TabBar function might be returning some components i.e Button or TouchableOpacity. Just use the onPress props of the component to open a logout alert just like you might be doing to navigate between the screens.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Siddharth Mishra |
