From 4220063f8464a9778fd8470b3fb95fe502fb1bd0 Mon Sep 17 00:00:00 2001 From: Janic Duplessis Date: Tue, 13 Dec 2016 13:41:00 -0800 Subject: [PATCH] Use native driver even if gestures are enabled Summary: Gestures now work with native animations so we can enable it, it is also not needed anymore to check if the native module exists since we print a warning in the Animated module now. **Test plan** Tested that animations and gesture work properly in the UIExplorer example. Also been using native animations with NavigationExperimental (ex-nav) in an app for a while. Closes https://github.com/facebook/react-native/pull/11234 Differential Revision: D4321763 Pulled By: ericvicenti fbshipit-source-id: 255bed5bfed3b93bdc10939b5a03d4d8b00ceade --- .../NavigationExperimental/NavigationCardStack.js | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/Libraries/CustomComponents/NavigationExperimental/NavigationCardStack.js b/Libraries/CustomComponents/NavigationExperimental/NavigationCardStack.js index 28032f94f5a206..f75bb6cd204561 100644 --- a/Libraries/CustomComponents/NavigationExperimental/NavigationCardStack.js +++ b/Libraries/CustomComponents/NavigationExperimental/NavigationCardStack.js @@ -32,7 +32,6 @@ */ 'use strict'; -const NativeAnimatedModule = require('NativeModules').NativeAnimatedModule; const NavigationCard = require('NavigationCard'); const NavigationCardStackPanResponder = require('NavigationCardStackPanResponder'); const NavigationCardStackStyleInterpolator = require('NavigationCardStackStyleInterpolator'); @@ -221,16 +220,7 @@ class NavigationCardStack extends React.Component { _configureTransition = () => { const isVertical = this.props.direction === 'vertical'; const animationConfig = {}; - 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) - ) { + if (NavigationCardStackStyleInterpolator.canUseNativeDriver(isVertical)) { animationConfig.useNativeDriver = true; } return animationConfig;