johanneslumpe / react-native-gesture-recognizers

Gesture recognizer decorators for react-native
MIT License
366 stars 55 forks source link

Use Animated #5

Closed rclai closed 8 years ago

rclai commented 8 years ago

Thankfully, because of the way you've built pannable, it was easy to simply make the container view an Animated.View, and get way better performance when panning as long as you supply an Animated.ValueXY to the style, which I show in the updated example. You can choose to not use Animated.ValueXY if you want and it will still work.

Using the setState method I was getting panning where the red box was terribly trailing my finger. With this change, the red box stayed right with my finger.

I haven't made this change on swipeable, but it should be fairly the same idea.

johanneslumpe commented 8 years ago

Ha sorry, totally missed this! Thanks!

johanneslumpe commented 8 years ago

If you could make the same change for swipeable, that would be appreciated.