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

126
Views
My tab navigation header button doesnt working. How can I fix it?

I'm trying to learn react native and I have a problem. Here I use tab navigation and I want to add an image in my headers right side and when the users touch that image I want use navigator, but it doesn't work.

import React, { useEffect, useState } from 'react'
import { View, StyleSheet, Image, TouchableOpacity } from 'react-native'
import { NavigationContainer } from '@react-navigation/native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'
import { createStackNavigator } from '@react-navigation/stack';


const TabNavigation = ({ navigation }) => {

    return (
    enter code here

 <Tab.Screen
          name="Home"
          component={HomeScreen}
          options={{
            headerTitle: () => (<Image source={require('../Images/Floody.png')} />),
            headerStyle: {
              height: 100
            },
            headerTitleAlign: 'center',
            headerRight: () => (
              <TouchableOpacity>
                <Image source={require('../Images/profile.jpg')} />
              </TouchableOpacity>
            ),
            tabBarIcon: ({ focused }) => focused ? <HomeImageColorfull /> : <HomeImageBlack />
          }} />
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The navigation object is passed by the navigation framework to the options of the screen. Hence, you can implement a onPress function for your TouchableOpacity of your headerRight component and use the navigation object from the options.

<Tab.Screen
   name="Home"
   component={HomeScreen}
   options={({navigation}) => ({
            headerTitle: () => (<Image source={require('../Images/Floody.png')} />),
            headerStyle: {
              height: 100
            },
            headerTitleAlign: 'center',
            headerRight: () => (
              <TouchableOpacity onPress={() => navigation.navigate("SomeScreenToNavigateTo")}>
                <Image source={require('../Images/profile.jpg')} />
              </TouchableOpacity>
            ),
            tabBarIcon: ({ focused }) => focused ? <HomeImageColorfull /> : <HomeImageBlack />
          })} />
about 4 years ago · Juan Pablo Isaza Report
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!