How can i put All and Favorites button in the header while using react-navigation?
1 Answer
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 }
});
6 Comments
JP.
care to provide example ?
bennygenel
@JP. added a mall example
Aditya
Where's the example ?
bennygenel
@Heisen-Berg answer
Aditya
Ok, but can you provide your
MyCustomComponent ? |
