Skip to content

Instantly share code, notes, and snippets.

@pietro909
Created June 18, 2017 17:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pietro909/8354b67ceb54ab20b83b742f21b764f7 to your computer and use it in GitHub Desktop.
Save pietro909/8354b67ceb54ab20b83b742f21b764f7 to your computer and use it in GitHub Desktop.
React Native: nested Navigator example
import React from "react";
import {
NavigationActions,
StackNavigator,
TabNavigator,
} from "react-navigation";
/* ...import pages... */
export const Welcome =
StackNavigator(
{
Landing: { screen: Landing },
SignUp: { screen: SignUp },
Login: { screen: Login },
},
{
headerMode: "screen",
initialRouteName: "Landing",
}
)
export const Home =
TabNavigator(
{
Profile: { screen: Profile },
Info: { screen: Info },
},
{
initialRouteName: "Info",
}
)
export const InfoTab =
StackNavigator(
{
Main: { screen: InfoMain },
MoreInfo: { screen: MoreInfo },
},
{
headerMode: "screen",
initialRouteName: "Main",
}
)
export const ProfileTab =
StackNavigator(
{
Main: { screen: ProfileMain },
},
{
Settings: { screen: ProfileSettings },
},
{
headerMode: "screen",
initialRouteName: "Main",
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment