Notes

React Navigation in Functional Components

Edit on GitHub

React Native & Expo

Set header title in stack navigator

1Component.navigationOptions = {
2  headerTitle: 'Conversations'
3}

headerTitle is a property that is specific to stack navigator. The alternative is title. headerTitle will default to title in other navigators.

or a callback function if you wanna use params (e.g. username in title)

1Home.navigationOptions = ({ navigation }) => {(
2    title: navigation.getParam('otherParam', 'A Nested Details Screen'),
3)}