Closed kientux closed 6 years ago
The warning you got sounds like a warning from react-navigation
, which is unrelated to the material bottom navigation. I think (dangerous superficial knowledge) that react-navigation wants you to put one navigator around your three StackNavigator
's. This one "base navigator" would be responsible for switching to the correct StackNavigator
, based on the active tab from BottomNavigation
.
Unfortunately that's all I can help you with react-navigation, because I currently don't really use react-navigation. If you need more support, you'd be better off asking them. 🙂
If you got it working, post your solution here to share your knowledge.
Since this is not an issue with react-native-material-bottom-navigation
, I'm going to close this issue, but you can still comment below.
What kind of Issue is this?
Question / Problem
Actual behavior
I'm using the example of
BottomNavigation
to build my simple app. I want the app to have 3 tabs managed byBottomNavigation
.renderContent()
function return aStackNavigator
ofreact-navigation
, based onactiveTab
. And I received the warningYou should only render one navigator explicitly in your app...
, it is described here: Explicitly rendering more than one navigatorIf I use only
react-navigation
:then the warning is gone. It seems that it is solved by export the stack directly instead of placing it inside a component (which is used by the example).
Expected behavior
So what is the proper way to use
BottomNavigation
? I'm new to react native so maybe this is a silly question.Additional resources
Environment