I'm using this react native tinder demo -> https://github.com/brentvatne/react-native-animated-demo-tinder
Is it possible to make the cards 'clickable' so it would navigate to another view on click? I've tried wrapping the "Touchable" components around the animated view but doing so disables the animations.
Any ideas would be highly appreciated, thanks!
Interpolation is a way of estimating a function at intermediate points, learning from the ranges you provide. In React Native, you can interpolate animated values using . interpolate which takes an inputRange, that interpolates and maps the values to an outputRange.
Another method (which worked better for me) is to create AnimatedTouchable component using createAnimatedComponent method of Animated:
const AnimatedTouchable = Animated.createAnimatedComponent(TouchableOpacity);
<AnimatedTouchable onPress={this.onPress}>
stuff here
</AnimatedTouchable>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With