ptomasroos / react-native-tab-navigator

A tab bar that switches between scenes, written in JS for cross-platform support
MIT License
2.4k stars 415 forks source link

Added ability to hide tab from tabbar but keep functionality. #141

Closed blumanski closed 6 years ago

blumanski commented 7 years ago

This is for views that don't need to be in the TabBar, such as Sign Up, Login and so on. One can basically use "external" links to navigate to tabs which not appear in the tab bar.

Example: <TabNavigator.Item selected={this.state.selectedTab === 'UserSignUpScreen'} title="Sign Up" hideTab={true} selectedTitleStyle={{color: '#fff'}} titleStyle={{color: '#fff'}} renderIcon={() => <IconSoc name="alert-octagon" style={{fontSize: 20, color: '#fff'}} />} renderSelectedIcon={() => <IconSoc name="alert-octagon" style={{fontSize: 20, color: '#bfeffc'}} />} onPress={() => this.changetab('selectedTab', 'UserSignUpScreen')}>

ide commented 7 years ago

Instead of hidden tabs, could you hide the entire TabNavigator (and its scenes)? That way the user can't get in a state where they are not on any (visible) tab but can still see the tab bar.

blumanski commented 7 years ago

I think that way, the back button would make problems. You could set the selected tab to keep a tab active. this.setState({'selectedTab', 'RaceListScreen'})

But that will create some other issues like the back button.

May I misunderstand what you want to achieve :-)

ptomasroos commented 6 years ago

Will close since this issue is more than a year, feel free to a open a new if this is still a issue.