How to declare navigationOptions for functional components?

Viewed 261

I want to set navigationOptions for a functional component. Every example shows only class components. How can I set navigationOptions?

Edit 1: Someone suggested me this solution

function YourComponent() {
  return <Text>Hi</Text>
}

YourComponent.navigationOptions = {
  tabBarLabel: 'Your custom label...',
}
0 Answers
Related