mirror of
https://github.com/status-im/react-native.git
synced 2025-02-04 05:34:15 +00:00
<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:
parent
1429b78af5
commit
7f54506f96
@ -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();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user