Skip to content

8. Nesting

Erik Poort edited this page May 3, 2018 · 1 revision

Nesting

Wherever you see SingleView, you can replace it with one of the other views. This doesn't have a limit. A real world example would be: You might want an app with a hamburger menu, where the home page has two tabs in which you can navigate. This would look like this:

navigation.start(
  <DrawerView id="drawer"
    left={<SingleView id="menu" screen={Menu} />}
    center={
      <TabView id="tabs">
        <StackView id="home_stack">
          <SingleView id="home" screen={Home} />
        </StackView>
        <StackView id="profile_stack">
          <SingleView id="profile" screen={Profile} />
        </StackView>
      </TabView>
    }
  />
);

Go wild!

Clone this wiki locally