Skip to content

Commit

Permalink
Revert D4321763: Use native driver even if gestures are enabled
Browse files Browse the repository at this point in the history
Differential Revision: D4321763

fbshipit-source-id: b43a733ea2234dd46add817bb83cca366ef83093
  • Loading branch information
Eric Vicenti authored and facebook-github-bot committed Dec 14, 2016
1 parent eb43f15 commit cbc413b
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
*/
'use strict';

const NativeAnimatedModule = require('NativeModules').NativeAnimatedModule;
const NavigationCard = require('NavigationCard');
const NavigationCardStackPanResponder = require('NavigationCardStackPanResponder');
const NavigationCardStackStyleInterpolator = require('NavigationCardStackStyleInterpolator');
Expand Down Expand Up @@ -220,7 +221,16 @@ class NavigationCardStack extends React.Component<DefaultProps, Props, void> {
_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;
Expand Down

0 comments on commit cbc413b

Please sign in to comment.