diff --git a/Libraries/CustomComponents/Navigator/Navigator.js b/Libraries/CustomComponents/Navigator/Navigator.js index 607e65041..8bfd55457 100644 --- a/Libraries/CustomComponents/Navigator/Navigator.js +++ b/Libraries/CustomComponents/Navigator/Navigator.js @@ -348,7 +348,12 @@ var Navigator = React.createClass({ this._navigationContext.dispose(); this._navigationContext = null; } - this.spring.removeAllListeners(); + + this.spring.destroy(); + + if (this._interactionHandle) { + this.clearInteractionHandle(this._interactionHandle); + } }, /** @@ -414,6 +419,9 @@ var Navigator = React.createClass({ * happening, we only set values for the transition and the gesture will catch up later */ _handleSpringUpdate: function() { + if (!this.isMounted()) { + return; + } // Prioritize handling transition in progress over a gesture: if (this.state.transitionFromIndex != null) { this._transitionBetween( @@ -435,6 +443,10 @@ var Navigator = React.createClass({ * This happens at the end of a transition started by transitionTo, and when the spring catches up to a pending gesture */ _completeTransition: function() { + if (!this.isMounted()) { + return; + } + if (this.spring.getCurrentValue() !== 1 && this.spring.getCurrentValue() !== 0) { // The spring has finished catching up to a gesture in progress. Remove the pending progress // and we will be in a normal activeGesture state