<Navigator />: 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.
This commit is contained in:
Hedger Wang 2015-06-22 11:04:40 -07:00
parent 1429b78af5
commit 7f54506f96

View File

@ -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();
}