Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

106
Views
Dynamically update screen header title on React Native Tab Navigator

I am using React Native Tab navigator and I am trying to have my Screen route names as header but with no luck. The fact that the screens are rendered inside the Tab Navigator makes it so their headers are ignored. I have tried setting headerShown=true and many other things with no luck.

This is part of my App.js code:

const AppStack = createStackNavigator({
  Navigation: {
    screen: NavigationScreen,
    navigationOptions: {
    }
  },
  Route: {
    screen: RouteScreen,
    navigationOptions: {
      // headerShown: false
      headerTitle: 'TestTitle'
    }
    },
  Confirm: {
    screen: ConfirmScreen,
    navigationOptions: {
      // headerShown: false
      headerTitle: 'TestTitle'
      
    }
    },
  Find: {
    screen: FindScreen,
    navigationOptions: {
      // headerShown: false
      headerTitle: 'TestTitle'
    }
    },
  Offer: {
    screen: OfferScreen,
    navigationOptions: {
      // headerShown: false
      headerTitle: 'TestTitle'
    }
    },

and here is my Navigation Screen code:

export default function NavigationScreen( {navigation}) {
  return (
    <NavigationContainer>
      <Tab.Navigator
        screenOptions={({ route }) => ({
          tabBarIcon: ({ color, size }) => {
            const icons = {
              Home: 'home',
              Profile: 'account',
              Offer: 'car-hatchback',
              Find: 'magnify'
            };

            return (
              <MaterialCommunityIcons
                name={icons[route.name]}
                color='#E9446A'
                size={30}
              />
            );
          },
        })}
      >
        <Tab.Screen name="Home" component={HomeScreen} />
        <Tab.Screen name="Profile" component={HomeTabScreen} />
        <Tab.Screen name="My Rides" children={()=><MyRidesScreen navigation={navigation}/>}  />
        <Tab.Screen name="Offer" children={()=><OfferScreen navigation={navigation}/>}  />
        <Tab.Screen name="Find" children={()=><FindScreen navigation={navigation}/>}  />
      </Tab.Navigator>
    </NavigationContainer>
  );
}

Any change attempted to the Tab.Screen routes via options is rendered on the bottom tab Names and not the screen header, as the parent screen is always Navigation Screen

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!