I am unable to add a headerRight button to my component.
I have a StackNavigator:
const profileNavigator = StackNavigator({
Profile: {
screen: PFProfileAuthenicate,
navigationOptions: {
title: 'Profile',
headerTintColor: 'white',
headerStyle: {
backgroundColor: Colors.primaryInput
}
}}
});
inside of a TabNavigator:
const iosTabs = TabNavigator({
Profile: {
screen: profileNavigator,
navigationOptions: {
tabBarLabel: 'Profile',
tabBarIcon: ({tintColor}) => (
<Image
source={require('../assets/face.png')}
style={[styles.icon, {tintColor: tintColor}]}
/>
)
}
} [...other tabs]
}, {
tabBarPosition: 'bottom',
});
The authenticator component is just rendering this:
render() {
if (this.props.authStore.isLoggedIn)
return <PFProfile navigation={this.props.navigation}/>;
else
return <PFLogin/>;
}
I am trying to add a right save button to the header in the PFProfile component. I've tried this and everything else I can find.
I'm thinking it has something to do with how the component in question isn't actually defined in navigator but nothing I've tried has been able to make this work.
I'm new to all this. Am I setting everything up right? Is that the best way to render the login vs. the profile? Any help would appreciated.
navigationOptionswhen I declare it in PFProfile. I wish there was a way to justreplacethe <PFLogin> with <PFProfile> in the render when the auth prop returns true.