Disable Press Effect in TouchableOpacity using React Native

Tiempo de lectura: < 1 minuto

Reading time: < 1 minute

Today I’m going to show you how to disable the effect that appears when using TouchableOpacity in React Native. When we press an element, it performs the following effect:

Sometimes it may not be suitable for the desired design.

To disable it, we need to add the following property to the TouchableOpacity component:

activeOpacity={1}

Like this:

<TouchableOpacity activeOpacity={1} onPress={action}> </TouchableOpacity>

Now, when you press the element, the animation will no longer be displayed.

Leave a Comment