2

How can i put All and Favorites button in the header while using react-navigation?

enter image description here

1 Answer 1

1

You can use headerTitle prop to render any custom component to use in your header.

headerTitle

String or React Element used by the header. Defaults to scene title

export const SimpleApp = StackNavigator({
  Home: {
    screen: HomeScreen,
    navigationOptions: {
      headerTitle: <MyCustomComponent />
    }
  },
  Profile: { screen: Profile }
});
Sign up to request clarification or add additional context in comments.

6 Comments

care to provide example ?
@JP. added a mall example
Where's the example ?
@Heisen-Berg answer
Ok, but can you provide your MyCustomComponent ?
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.