Feat hideable tabs in TabBar
·
166 commits
to feat-hidden-tabs
since this release
In this fork of react-navigation (1.0.0-beta.27), tabs created in a TabNavigator can now be hidden from the TabBar by setting the { hiddenTabs: ['MyTab'] } config.
To hide a tab by default, you can write:
const tabNav = TabNavigator({
FirstTab: { screen: firstScreen },
SomeTab: { screen: secondScreen },
}, {
hiddenTabs: ['SomeTab']
});
Hidden tabs can be made visible again by dispatching the showTab
action, like so:
this.props.navigation.dispatch(
NavigationActions.showTab({ tabRouteName: 'SomeTab' })
);
Tabs can also be hidden programatically with the hideTab
action:
this.props.navigation.dispatch(
NavigationActions.hideTab({ tabRouteName: 'SomeTab' })
);