How to make React Native Animated.View available?

I use this reaction based on the native tinder entry -> https://github.com/brentvatne/react-native-animated-demo-tinder

Can I make clicks "available" to go to a different view? I tried wrapping the Touchable components around an animated view, but it turned off the animation.

Any ideas would be much appreciated, thanks!

+4
source share
2 answers

I think you can use TouchableX inside Animated.View

<Animated.View>
  <TouchableOpacity>
    <View>
      stuff
    <View>
  </TouchableOpacity>
</Animated.View>`
+4
source

you need to write a method to animate inside.

renderButton: function() {
  return (
    <TouchableOpacity onPress={this._onPressButton}>
      <Image
        style={styles.button}
        source={require('./myButton.png')}
      />
    </TouchableOpacity>
  );
},

render()

_onPressButton(){
........
........
}
0

Source: https://habr.com/ru/post/1608656/


All Articles