Skip to content

5. Tabs

Erik Poort edited this page May 3, 2018 · 3 revisions

Structure

This is how you run the app with tab bar navigation:

navigation.start(
  <TabView id="tabbar">
    <SingleView id="home" screen={Home} />
    <SingleView id="home" screen={Home} />
    <SingleView id="home" screen={Home} />
  </StackView>
);

Calls

Calls are navigator type specific, so you should access them that way as well. It doesn't make sense to call 'push' on a tabbar, so these calls are split up.
You can access the navigation via the props:

this.props.tabs

Because you can nest navigation types, you can also access the navigator by its id (in the example above 'tabbar'):

this.props.tabbar

Open tab

To programmatically switch to another tab:

this.props.tabs.openTab(1);
Clone this wiki locally