From cbc413ba87caffc40ae67040ce85340908f8bc07 Mon Sep 17 00:00:00 2001 From: Eric Vicenti Date: Wed, 14 Dec 2016 15:27:41 -0800 Subject: [PATCH] Revert D4321763: Use native driver even if gestures are enabled Differential Revision: D4321763 fbshipit-source-id: b43a733ea2234dd46add817bb83cca366ef83093 --- .../NavigationExperimental/NavigationCardStack.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Libraries/CustomComponents/NavigationExperimental/NavigationCardStack.js b/Libraries/CustomComponents/NavigationExperimental/NavigationCardStack.js index f75bb6cd2..28032f94f 100644 --- a/Libraries/CustomComponents/NavigationExperimental/NavigationCardStack.js +++ b/Libraries/CustomComponents/NavigationExperimental/NavigationCardStack.js @@ -32,6 +32,7 @@ */ 'use strict'; +const NativeAnimatedModule = require('NativeModules').NativeAnimatedModule; const NavigationCard = require('NavigationCard'); const NavigationCardStackPanResponder = require('NavigationCardStackPanResponder'); const NavigationCardStackStyleInterpolator = require('NavigationCardStackStyleInterpolator'); @@ -220,7 +221,16 @@ class NavigationCardStack extends React.Component { _configureTransition = () => { const isVertical = this.props.direction === 'vertical'; const animationConfig = {}; - if (NavigationCardStackStyleInterpolator.canUseNativeDriver(isVertical)) { + if ( + !!NativeAnimatedModule + + // Gestures do not work with the current iteration of native animation + // driving. When gestures are disabled, we can drive natively. + && !this.props.enableGestures + + // Native animation support also depends on the transforms used: + && NavigationCardStackStyleInterpolator.canUseNativeDriver(isVertical) + ) { animationConfig.useNativeDriver = true; } return animationConfig;