Reputation: 319
I would like to change my navigationbar background color , but return to me : TypeError: Object is not a function(evaluating 'renderHeader');
How can i fix this error?
static navigationOptions = ({navigation}) => ({
title: 'Login',
header: {
title: "Title",
style: {
backgroundColor: 'red'
},
tintColor: 'red'
}
});
Upvotes: 3
Views: 1831
Reputation: 1433
Try this...
static navigationOptions = () => ({
title: 'Contact Us',
headerTintColor: Colors.Green,
headerStyle: {
backgroundColor: 'red'
}
});
To hide navigationbar
for specific page
static navigationOptions = {
header:null
}
Upvotes: 4
Reputation: 24204
I guess, navigationOptions
should be Object. Try this:
static navigationOptions = {
title: 'Login',
header: {
title: "Title",
style: {
backgroundColor: 'red'
},
tintColor: 'red'
}
};
Upvotes: 2