From 7f54506f96ff44add072ea1f83fd6650ab7a750b Mon Sep 17 00:00:00 2001 From: Hedger Wang Date: Mon, 22 Jun 2015 11:04:40 -0700 Subject: [PATCH] : Fix the getter for `navigationContext`. Summary: @public The current getter for `navigationContext` always return a static context, and it should return an instance-based one, instead. Test Plan: Use console.log() in inspect that two different navigators do have their own `navigationContext` created. --- Libraries/CustomComponents/Navigator/Navigator.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Libraries/CustomComponents/Navigator/Navigator.js b/Libraries/CustomComponents/Navigator/Navigator.js index 93610e973..c6e3a888b 100644 --- a/Libraries/CustomComponents/Navigator/Navigator.js +++ b/Libraries/CustomComponents/Navigator/Navigator.js @@ -289,6 +289,9 @@ var Navigator = React.createClass({ }, componentWillMount: function() { + // TODO(t7489503): Don't need this once ES6 Class landed. + this.__defineGetter__('navigationContext', this._getNavigationContext); + this._subRouteFocus = []; this.parentNavigator = this.props.navigator; this._handlers = {}; @@ -1153,8 +1156,7 @@ var Navigator = React.createClass({ ); }, - // Getter for `navigationContext`. - get navigationContext() { + _getNavigationContext: function() { if (!this._navigationContext) { this._navigationContext = new NavigationContext(); }