airbnb / native-navigation

Native navigation library for React Native applications

Home Page:http://airbnb.io/native-navigation/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

titleView prop in Navigator.Config?

nfcampos opened this issue · comments

Would it make sense to add a titleView prop to Navigator.Config to be able to use a custom view in place of the title?
Something like:

<Navigator.Config
  titleView="SomeView"
/>

where SomeView is

...
AppRegistry.registerComponent('SomeView', () => SomeView)

and possibly a titleViewProps prop for props to pass to the view.

It's not the ideal API, I think, I'd want this instead

<Navigator.Config
  titleView={<SomeView prop="value" />}
/>

but I'm not sure how feasible that is

Super useful either way IMO, what do you guys think?

(EDIT: this might make sense only for iOS, not sure about that)

I have a pull request that adds support for a title view image, which is a fairly common use case there. I have it on my to do list to add support for a full on title view that is a component.