After going through various SO posts and documents I found the following ways to do this -
In the Component using setOptions
this.props.navigation.setOptions({title: 'TitleSetInComponent'});
Can also give a default title in createStackNavigator();
<Stack.Screen
name="myComponent"
component={MyComponent}
options={{
title: 'TitleSetInStackNavigator',
}}
/>
In createStackNavigator();
using navigationOptions
as options
<Stack.Screen
name="myComponent"
component={MyComponent}
options={MyComponent.navigationOptions}
/>
// MyComponent
static navigationOptions = {
title: 'TitleSetInComponent',
};