From 2ae77defa2f15b3076a5c2dd9d365a3911fad1b1 Mon Sep 17 00:00:00 2001 From: "Hao (Harin) Wu" <46661377+Harin329@users.noreply.github.com> Date: Wed, 2 Sep 2020 12:05:07 -0700 Subject: [PATCH] useNativeDriver warnings fixed (#17) * Added Native Driver Tags * remove optional empty listener * Bump Package Version * minor refactor Co-authored-by: Bogdan Pop --- Swiper.js | 8 +++++--- package.json | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Swiper.js b/Swiper.js index 71ce9b4b..ac7f081e 100644 --- a/Swiper.js +++ b/Swiper.js @@ -195,7 +195,7 @@ class Swiper extends Component { }) } - return Animated.event([null, this.createAnimatedEvent()])( + return Animated.event([null, this.createAnimatedEvent()], { useNativeDriver: false })( event, gestureState ) @@ -344,7 +344,8 @@ class Swiper extends Component { Animated.spring(this.state.pan, { toValue: 0, friction: this.props.topCardResetAnimationFriction, - tension: this.props.topCardResetAnimationTension + tension: this.props.topCardResetAnimationTension, + useNativeDriver: true }).start(cb) this.state.pan.setOffset({ @@ -416,7 +417,8 @@ class Swiper extends Component { x: x * SWIPE_MULTIPLY_FACTOR, y: y * SWIPE_MULTIPLY_FACTOR }, - duration: this.props.swipeAnimationDuration + duration: this.props.swipeAnimationDuration, + useNativeDriver: true }).start(() => { this.setSwipeBackCardXY(x, y, () => { mustDecrementCardIndex = mustDecrementCardIndex diff --git a/package.json b/package.json index 79b9ff9c..22d778b1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-deck-swiper", - "version": "2.0.2-beta", + "version": "2.0.3-beta", "description": "Awesome tinder like card swiper for react-native. Highly Customizable!", "main": "index.js", "scripts": {