native-navigation icon indicating copy to clipboard operation
native-navigation copied to clipboard

titleView prop in Navigator.Config?

Open nfcampos opened this issue 8 years ago • 1 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)

nfcampos avatar Apr 30 '17 18:04 nfcampos

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.

benkraus avatar May 02 '17 22:05 benkraus