Skip to content
This repository has been archived by the owner on Feb 8, 2020. It is now read-only.

Commit

Permalink
fix: use native driver for gestures
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed Jan 1, 2020
1 parent ef0f5d6 commit 9356598
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions packages/stack/src/views/Stack/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -376,15 +376,18 @@ export default class Card extends React.Component<Props> {
} = interpolatedStyle;

const handleGestureEvent = gestureEnabled
? Animated.event([
{
nativeEvent:
gestureDirection === 'vertical' ||
gestureDirection === 'vertical-inverted'
? { translationY: gesture }
: { translationX: gesture },
},
])
? Animated.event(
[
{
nativeEvent:
gestureDirection === 'vertical' ||
gestureDirection === 'vertical-inverted'
? { translationY: gesture }
: { translationX: gesture },
},
],
{ useNativeDriver: true }
)
: undefined;

const { backgroundColor } = StyleSheet.flatten(contentStyle || {});
Expand Down

0 comments on commit 9356598

Please sign in to comment.