navigationOptions functional components
I just tried this, but it doesn't seem to work for me:
const HomeScreen = props => {
return <Text>Hello World</Text>
}
HomeScreen.navigationOptions = screenProps => ({
headerTitle: (props) => <Text>Start</Text>,
})
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen name="Home" component={HomeScreen} />
</Stack.Navigator>
</NavigationContainer>
Instead of rendering "Start", it renders "Home". I'm using version 5.10.0
EDIT: Not sure if this is just a hack or not, but it works for me...
<Stack.Screen
name="Home"
component={HomeScreen}
options={HomeScreen.navigationOptions} />