React Navigation in Functional Components
November 7, 2019
Set header title in stack navigator
code
Component.navigationOptions = {
headerTitle: "Conversations",
};
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)
code
Home.navigationOptions = ({ navigation }) => {(
title: navigation.getParam('otherParam', 'A Nested Details Screen'),
)}