Skip to content

Commit

Permalink
NavigatorIOS - Remove NavigationContext
Browse files Browse the repository at this point in the history
Reviewed By: fkgozali

Differential Revision: D4774022

fbshipit-source-id: 0184bcbcf6a458eac6377cc6e1cffc0924f0d2d2
  • Loading branch information
Eric Vicenti authored and facebook-github-bot committed Mar 27, 2017
1 parent af34c34 commit 7aa2c9a
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions Libraries/Components/Navigation/NavigatorIOS.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

var EventEmitter = require('EventEmitter');
var Image = require('Image');
var NavigationContext = require('NavigationContext');
var RCTNavigatorManager = require('NativeModules').NavigatorManager;
var React = require('React');
var ReactNative = require('ReactNative');
Expand Down Expand Up @@ -499,7 +498,6 @@ var NavigatorIOS = React.createClass({
},

navigator: (undefined: ?Object),
navigationContext: new NavigationContext(),

componentWillMount: function() {
// Precompute a pack of callbacks that's frequently generated and passed to
Expand All @@ -515,19 +513,14 @@ var NavigatorIOS = React.createClass({
resetTo: this.resetTo,
popToRoute: this.popToRoute,
popToTop: this.popToTop,
navigationContext: this.navigationContext,
};
this._emitWillFocus(this.state.routeStack[this.state.observedTopOfStack]);
},

componentDidMount: function() {
this._emitDidFocus(this.state.routeStack[this.state.observedTopOfStack]);
this._enableTVEventHandler();
},

componentWillUnmount: function() {
this.navigationContext.dispose();
this.navigationContext = new NavigationContext();
this._disableTVEventHandler();
},

Expand Down Expand Up @@ -608,7 +601,6 @@ var NavigatorIOS = React.createClass({

_handleNavigatorStackChanged: function(e: Event) {
var newObservedTopOfStack = e.nativeEvent.stackLength - 1;
this._emitDidFocus(this.state.routeStack[newObservedTopOfStack]);

invariant(
newObservedTopOfStack <= this.state.requestedTopOfStack,
Expand Down Expand Up @@ -661,14 +653,6 @@ var NavigatorIOS = React.createClass({
});
},

_emitDidFocus: function(route: Route) {
this.navigationContext.emit('didfocus', {route: route});
},

_emitWillFocus: function(route: Route) {
this.navigationContext.emit('willfocus', {route: route});
},

/**
* Navigate forward to a new route.
* @param route The new route to navigate to.
Expand All @@ -678,7 +662,6 @@ var NavigatorIOS = React.createClass({
// Make sure all previous requests are caught up first. Otherwise reject.
if (this.state.requestedTopOfStack === this.state.observedTopOfStack) {
this._tryLockNavigator(() => {
this._emitWillFocus(route);

var nextStack = this.state.routeStack.concat([route]);
var nextIDStack = this.state.idStack.concat([getuid()]);
Expand Down Expand Up @@ -709,7 +692,6 @@ var NavigatorIOS = React.createClass({
this._tryLockNavigator(() => {
var newRequestedTopOfStack = this.state.requestedTopOfStack - n;
invariant(newRequestedTopOfStack >= 0, 'Cannot pop below 0');
this._emitWillFocus(this.state.routeStack[newRequestedTopOfStack]);
this.setState({
requestedTopOfStack: newRequestedTopOfStack,
makingNavigatorRequest: true,
Expand Down Expand Up @@ -758,8 +740,6 @@ var NavigatorIOS = React.createClass({
updatingAllIndicesAtOrBeyond: index,
});

this._emitWillFocus(route);
this._emitDidFocus(route);
},

/**
Expand Down

0 comments on commit 7aa2c9a

Please sign in to comment.