expo / ex-navigator

Route-centric navigation built on top of React Native's Navigator
MIT License
522 stars 68 forks source link

Imperatively Change Route Title #44

Closed cancan101 closed 9 years ago

cancan101 commented 9 years ago

Provide a way to imperatively change the title shown in the ExNavigator for the current route.

ide commented 9 years ago

The way to do this is to implement renderTitle with a custom view that has an imperative method. There are several possible transitions for setting a title (e.g. cross-fading, sliding in, fading out then fading in) so ExNavigator lets you implement whatever behavior is right for your app.

cancan101 commented 9 years ago

@ide how do I get a reference to the view returned by renderTitle?

ide commented 9 years ago
renderTitle={() => <View ref={c = { this._title = c; } />}

It's all standard React and JS all the way down.