mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-06 22:44:22 +08:00
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:
committed by
facebook-github-bot-4
parent
0f0b57880f
commit
df70005c12
@@ -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,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user