Reputation: 75
I have a bottomTabNavigator and a topTabNavigator, if I click on the first tab of my bottom nav it loads the first tab of my top nav. What I want is for the first tab of my bottom nav to have it's own page loaded when being clicked on and still have the top nav being there. But how do I make this possible?
I've tried several things that came to my mind.
// This is my code, what I want is for Home in the bottom nav to go to the home page
// and on the home page still have the bottom nav and top nav visible.
// How does the menu structure need to look like to make this happen?
export const HomeTop = createMaterialTopTabNavigator({
Introductie:{
screen: Introduction
},
Blog:{
screen: () => <NoAuth/>
},
{...}
});
export const MiddleScreens = createBottomTabNavigator({
Home:{
screen: HomeTop
},
{...}
});
I haven't been able to make it happen what I want to achieve. Also since I'm quite clueless at the moment as to what else to try. I'm using react navigation V3. Is there a simpler way to make it happen? Or are there any workarounds that work with this version?
In short: I want a top nav and bottom nav on first tab page of bottom nav which is a page on it's own.
Upvotes: 0
Views: 161
Reputation: 86
I Guess Tabs wont work in the case of yours. Since Tabs will be defaulted to 1st Page of TabList.
One work around will be have two Buttons and a View on the 1st Page of your Top Nav.
Initially load home page on your view, Once user presses Button 1, load your 1st Tab details, if he presses Button 2 load second Tab details.
You can handle this with a flag in state.
Hope it helps. Feel free to clarify if you have any doubts.
Upvotes: 1