Skip to content

Commit

Permalink
useNativeDriver warnings fixed (#17)
Browse files Browse the repository at this point in the history
* Added Native Driver Tags
* remove optional empty listener
* Bump Package Version
* minor refactor
Co-authored-by: Bogdan Pop <[email protected]>
  • Loading branch information
Harin329 authored Sep 2, 2020
1 parent 696a534 commit 2ae77de
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions Swiper.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ class Swiper extends Component {
})
}

return Animated.event([null, this.createAnimatedEvent()])(
return Animated.event([null, this.createAnimatedEvent()], { useNativeDriver: false })(
event,
gestureState
)
Expand Down Expand Up @@ -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({
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down

0 comments on commit 2ae77de

Please sign in to comment.