[NavigatorIOS] Add ability to set custom component as title
UIKit's UINavigationItem has a UIView property 'titleView' which allows to set custom view as a navigation bar title. Would be nice to have that in react-native. Two ways as I see it:
- Child component of the NavigatorIOS:
<NavigatorIOS
itemWrapperStyle={styles.nav}
initialRoute={{
component: NewsView
}}>
{someFancyCustomTitleComponent}
</NavigatorIOS>
- Parameter of the NavigatorIOS:
<NavigatorIOS
itemWrapperStyle={styles.nav}
initialRoute={{
component: NewsView
}}
titleComponent={someFancyCustomTitleComponent}
/>
So probably child component or parameter(or other way of ding it?) should be set to the instance of RCTNavItem and then RCTWrapperViewController should set it to corresponding UINavigationItem's titleView, but I don't have any idea how to convert react component to UIView.
Sorry for leaving this so long - I've ended up using https://github.com/wix/react-native-navigation and https://github.com/wix/react-native-controllers.
I'm sure this is heavily debated elsewhere but for me the idea of React Native was to use native components (as per above)...not a non-native feeling replacement (Navigator Experimental)
@facebook-github-bot label Icebox
Hi there! This issue is being closed because it has been inactive for a while.
But don't worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/navigatorios-add-ability-to-set-custom-component-as-title
ProductPains helps the community prioritize the most important issues thanks to its voting feature. It is easy to use - just login with GitHub.
Also, if this issue is a bug, please consider sending a PR with a fix. We're a small team and rely on the community for bug fixes of issues that don't affect fb apps.
@facebook-github-bot close
@charpeni tells me to close this issue. If you think it should still be opened let us know why.
Easily achievable with https://reactnavigation.org now.