I am using tabs in my react native project. I wanted to update Header text and show/hide left, right button on tab click in react native.
I am using this code for Tabs Navigation and StackNavigator for Tabs Screens:
const TabScreen = createMaterialTopTabNavigator(
{
AllChallenges: {
screen: AllChallenges,
navigationOptions: {
title: 'All CHALLENGES',
fontFamily: Fonts.medium,
header: null,
}
},
YourProgress: {
screen: YourProgress,
navigationOptions: {
title: 'YOUR PROGRESS',
fontFamily: Fonts.medium,
header: null,
}
},
},
{
tabBarPosition: 'top',
header: null,
swipeEnabled: false,
animationEnabled: true,
tabBarOptions: {
activeTintColor: 'rgb(94,94,95)',
inactiveTintColor: 'rgb(221,221,221)',
style: {
backgroundColor: '#ffffff',
height: 40,
},
labelStyle: {
marginTop: 5,
textAlign: 'center',
fontFamily: Fonts.medium,
fontSize: 12,
},
indicatorStyle: {
borderBottomColor: 'rgb(32,186,113)',
borderBottomWidth: 2,
},
},
}
);
//making a StackNavigator to export as default
const Challenges = createStackNavigator({
TabScreen: {
screen: TabScreen,
header: null,
navigationOptions: ({ navigation }) => {
// ListAisle.headerList()
return {
title: "CHALLENGES",
headerTintColor: 'white',
headerTitleStyle: {
textAlign: 'center',
flexGrow: 2,
alignSelf: 'center',
marginLeft: 12,
fontFamily: Fonts.summerNormal,
fontSize: 25,
},
headerStyle: {
backgroundColor: '#ff6500'
},
tabBarOnPress: () => Alert.alert('hello')
}
},
},
});
In below screenshot on tapped checkbox button, I want to show delete button in the header
Any idea how to update the title and show hide header buttons?