calling navigationBar's overridden ref function

Summary: Before that it was not possible to get a ref to a navigation bar (unless using Navigator's internal `_navBar` prop)
Closes https://github.com/facebook/react-native/pull/3755

Reviewed By: svcscm

Differential Revision: D2674315

Pulled By: nicklockwood

fb-gh-sync-id: 26120f7bcbb675e8217b8bd963dcc6ed314d4ba3
This commit is contained in:
Danny Arnold
2015-11-30 07:32:24 -08:00
committed by facebook-github-bot-4
parent 0f0b57880f
commit df70005c12

View File

@@ -1087,7 +1087,10 @@ var Navigator = React.createClass({
return null;
}
return React.cloneElement(this.props.navigationBar, {
ref: (navBar) => { this._navBar = navBar; },
ref: (navBar) => {
this.props.navigationBar.ref instanceof Function && this.props.navigationBar.ref(navBar);
this._navBar = navBar;
},
navigator: this._navigationBarNavigator,
navState: this.state,
});