Create a Draggable Card with React Native Pan Responder, and Animated.decay

InstructorJason Brown

Share this video with your friends

Send Tweet

In this lesson we'll create a PanResponder to allow us to drag a card around the screen. We'll use Animated.event to automatically set the values of our Animated.Value and when the card is released we'll use Animated.decay to decelerate it to a stop.

peekpic
~ 8 years ago

getting 404 on the github link

Jason Browninstructor
~ 8 years ago

Apologies for that, I accidentally named it animated_decay instead of just decay. I've fixed the link and it should have the proper code.

peekpic
~ 8 years ago

great, thanks!

Serdar Degirmenci
~ 7 years ago

Hello, unfortunately decay example in onPanResponderRelease doesn't work.

I also tried it with your code, it didn't work also. Box disappear after release.

I installed my version from Expo and this is the dependency status: "dependencies": { "expo": "^18.0.4", "react": "16.0.0-alpha.12", "react-native": "https://github.com/expo/react-native/archive/sdk-18.0.1.tar.gz", }