React-native-animatable: Animatable.TouchableOpacity | WithoutFeedback | Highlight

Created on 5 Sep 2016  路  3Comments  路  Source: oblador/react-native-animatable

I really think these should be included by default, as you cannot wrap them with

TouchableOpacity = Animatable.createAnimatableComponent(TouchableOpacity);

as you'll get an error about the component being read-only.

I'm aware that you can wrap your Touchable's in an Animatable.View however, when your parent has the animation already, the nest becomes really complicated and messy, for example if you wanted to have an animation on a click event that changed styles, but slide the component in on load, and slide the component out when another event happens.

Most helpful comment

You didn't apply the code I wrote :-)

Try

const AnimatableTouchableHighlight = Animatable.createAnimatableComponent(TouchableHighlight );

All 3 comments

The error you are getting is because you are trying to overwrite a constant/imported value. Try this instead:

const AnimatableTouchableOpacity = Animatable.createAnimatableComponent(TouchableOpacity);

You didn't apply the code I wrote :-)

Try

const AnimatableTouchableHighlight = Animatable.createAnimatableComponent(TouchableHighlight );

Oh my god. I am so sorry.
It worked as expected now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ovaris picture ovaris  路  4Comments

quangtruong16994 picture quangtruong16994  路  5Comments

patrickml picture patrickml  路  10Comments

JakeHadley picture JakeHadley  路  3Comments

ggomaeng picture ggomaeng  路  5Comments