From 5ce6623ec026b8f5518ad27ed84bc2e52d81f049 Mon Sep 17 00:00:00 2001 From: Bruno Lemos Date: Fri, 13 Apr 2018 23:58:30 -0300 Subject: [PATCH] Fix: undefined is not an object (evaluating sceneConfig.animationInterpolators) Fix https://github.com/facebook/react-native/issues/12742 --- src/Navigator.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Navigator.js b/src/Navigator.js index 08f51df..b41bf96 100644 --- a/src/Navigator.js +++ b/src/Navigator.js @@ -1000,9 +1000,7 @@ var Navigator = createReactClass({ _transitionSceneStyle: function(fromIndex, toIndex, progress, index) { var viewAtIndex = this._sceneRefs[index]; - if (viewAtIndex === null || viewAtIndex === undefined) { - return; - } + if (!viewAtIndex) return; // Use toIndex animation when we move forwards. Use fromIndex when we move back var sceneConfigIndex = fromIndex < toIndex ? toIndex : fromIndex; var sceneConfig = this.state.sceneConfigStack[sceneConfigIndex]; @@ -1010,6 +1008,7 @@ var Navigator = createReactClass({ if (!sceneConfig) { sceneConfig = this.state.sceneConfigStack[sceneConfigIndex - 1]; } + if (!sceneConfig) return; var styleToUse = {}; var useFn = index < fromIndex || index < toIndex ? sceneConfig.animationInterpolators.out :