React Native Tab Navigator first tab is focused by default

1.4k views Asked by At

I'm using React Native BottomTabNavigator.

Example:

<Tab.Navigator tabBarOptions={tabBarOptions} screenOptions={screenOptions}>
  <Tab.Screen name="Home" component={Home} />
  <Tab.Screen name="Saved" component={Saved} />
  <Tab.Screen name="Map" component={Map} />
  <Tab.Screen name="Profile" component={Profile} />
</Tab.Navigator>

I want to make the last tab focused instead of the first. I can't find any option in the documentation.

It should be something like options={{ focused: true }} Or maybe it's not implemented at all

1

There are 1 answers

0
ATEC HUO On
<Tab.Navigator initialRouteName={"Your Initial Screen Name"}
...>
</Tab.Navigator>