From df70005c12e3be14bfbdf0b32f9ea0a5c052deba Mon Sep 17 00:00:00 2001 From: Danny Arnold Date: Mon, 30 Nov 2015 07:32:24 -0800 Subject: [PATCH] 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 --- Libraries/CustomComponents/Navigator/Navigator.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Libraries/CustomComponents/Navigator/Navigator.js b/Libraries/CustomComponents/Navigator/Navigator.js index ff7ff2c63..e11ee2505 100644 --- a/Libraries/CustomComponents/Navigator/Navigator.js +++ b/Libraries/CustomComponents/Navigator/Navigator.js @@ -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, });