react-navigation / web

Tools for react-navigation on web browsers and servers
https://reactnavigation.org
MIT License
94 stars 28 forks source link

how to define an index route? #35

Closed chrisdrackett closed 5 years ago

chrisdrackett commented 5 years ago

I'm looking to define a route for / but I'm not sure how to do this. I was hoping that the value of initialRouteName would be used to define the base route, but that isn't the case.

chrisdrackett commented 5 years ago

I figured this out, the following works:

const AppContainer = createBrowserApp(
  createStackNavigator(
    {
      Home: {
         screen: Home,
         path: ''     
    },
      Profile,
    },
    {
      initialRouteName: 'Home',
    },
  ),
)

I had been trying to use / as the path that causes issues!