I am trying to navigate to a different route when a button in the header is clicked. Using react-navigation in my react-native project.
static navigationOptions = ({ navigation, screenProps }) => ({
title: 'Header Text',
headerRight:
<Button
title="Settings"
backgroundColor="rgba(0,0,0,0)"
color="rgba(0,122,255,1)"
onPress={() => navigation.navigate('settings')}
/>,
});
ERROR - Invariant Violation: Invariant Violation: Objects are not valid as a React child (found: object with keys {style}
My package.json entry for react-navigation
"react-navigation": "^1.5.10"
None of the solutions described here seems to work. Probably due to different version??
https://github.com/react-navigation/react-navigation/issues/286
package, do you get this error afterbutton click? If so please post the code for thesettings screen. - Pritish Vaidya