Issue with NativeBase tab bar mixed with react navigation
See original GitHub issue
We are getting these 2 issues when mix NativeBase tab bar and react navigation. Here is the code:
const MainTabBar = TabNavigator(
{
Saved: {screen: SavedScreen},
Chat: {screen: ChatScreen},
Profile: {screen: ProfileScreen},
},
{
tabBarPosition: 'bottom',
swipeEnabled: false,
tabBarComponent: props => {
return (
<Footer>
<FooterTab>
<Button
vertical
active={props.navigationState.index === 0}
onPress={() => props.navigation.navigate("Saved")}>
<Icon name="bowtie" />
<Text>Lucy</Text>
</Button>
<Button
vertical
active={props.navigationState.index === 1}
onPress={() => props.navigation.navigate("Profile")}>
<Icon name="briefcase" />
<Text>Nine</Text>
</Button>
<Button
vertical
active={props.navigationState.index === 2}
onPress={() => props.navigation.navigate("Chat")}>
<Icon name="headset" />
<Text>Jade</Text>
</Button>
</FooterTab>
</Footer>
);
}
}
);
const Main = StackNavigator(
{
Signin: {screen: SigninScreen},
Signup1: {screen: SignupScreen1},
Welcome: {screen: WelcomeScreen},
Settings: {screen: SettingsScreen},
MainTab: {screen: MainTabBar}
},
{
initialRouteName: "Signin",
headerMode: "none",
},
);
P.S you may noticed we used the code from your tutorial 😃 How these issues can be fixed? What is wrong in this code? Thanks in advance!
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (3 by maintainers)
Top Results From Across the Web
Supporting safe areas
The rest of this guide gives more information on how to support safe areas in React Navigation. Hidden/Custom Header or Tab Bar. Default...
Read more >Native Base Tab Bar issue - react native
Trying to import tabs from native base fails with the following error: Element type is invalid: expected a string (for built-in components) but ......
Read more >How to Combine Bottom Tabs, Top Tabs and a Hamburger ...
This guide will walk you through creating a simple application that contains bottom tab navigation, top tabs, and a hamburger menu to give...
Read more >Components
The Components are constructed in pure React Native platform along with some JavaScript ... tabs, toast, drawer, thumbnail, spinner, layout, search bar etc....
Read more >react-native-tab-view
API reference. The package exports a TabView component which is the one you'd use to render the tab view, and a TabBar component ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
if want to implement with
react-navigation 3.0
withnative-base 2.13
then below code will work.@ArtyomBaykov tried a similar code. It was working fine with react-navigation
Code
Gif