From d4cc2a6d16d5e72706fd7368b9adae12ff841d95 Mon Sep 17 00:00:00 2001 From: Matt Labrum Date: Fri, 9 Jun 2017 09:37:56 +0930 Subject: [PATCH] Removed isMounted and added a state to track if the component is mounted --- src/Navigator.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Navigator.js b/src/Navigator.js index b714e99..ee89e4a 100644 --- a/src/Navigator.js +++ b/src/Navigator.js @@ -439,6 +439,7 @@ var Navigator = React.createClass({ activeGesture: null, pendingGestureProgress: null, transitionQueue: [], + mounted: false }; }, @@ -477,6 +478,7 @@ var Navigator = React.createClass({ }, componentDidMount: function() { + this.setState({mounted: true}) this._handleSpringUpdate(); this._emitDidFocus(this.state.routeStack[this.state.presentedIndex]); this._enableTVEventHandler(); @@ -571,7 +573,7 @@ var Navigator = React.createClass({ * happening, we only set values for the transition and the gesture will catch up later */ _handleSpringUpdate: function() { - if (!this.isMounted()) { + if (!this.state.mounted) { return; } // Prioritize handling transition in progress over a gesture: @@ -595,7 +597,7 @@ 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()) { + if (!this.state.mounted) { return; }