Make tabBar visible when no config is gived. Fixes #239

This commit is contained in:
Satyajit Sahoo 2017-02-09 01:22:54 +05:30
parent 8e8c4fb9a1
commit 797833a69a

View File

@ -88,11 +88,10 @@ class TabView extends PureComponent<void, Props, void> {
const tabBar = this.props.router.getScreenConfig(this.props.childNavigationProps[route.key], 'tabBar');
if (tabBar && typeof tabBar.label !== 'undefined') {
return tabBar.label;
} else {
const title = this.props.router.getScreenConfig(this.props.childNavigationProps[route.key], 'title');
if (typeof title === 'string') {
return title;
}
}
const title = this.props.router.getScreenConfig(this.props.childNavigationProps[route.key], 'title');
if (typeof title === 'string') {
return title;
}
return route.routeName;
};
@ -160,7 +159,9 @@ class TabView extends PureComponent<void, Props, void> {
const { state } = this.props.navigation;
const tabBar = this.props.router.getScreenConfig(this.props.childNavigationProps[state.routes[state.index].key], 'tabBar');
if (tabBarComponent !== undefined && tabBar && tabBar.visible !== false) {
const tabBarVisible = tabBar ? tabBar.visible !== false : true;
if (tabBarComponent !== undefined && tabBarVisible) {
if (tabBarPosition === 'bottom') {
renderFooter = this._renderTabBar;
} else {