How to Disable TouchableOpacity Component in React Native

TouchableOpacity is one of the most using components in React Native projects. Reason is simple, TouchableOpacity is much more flexible and highly customisable than components such as Button. As I mentioned in the title, you can either disable or enable TouchableOpacity according to your requirement.

All you need to use is disabled prop of Touchable Opacity. The disabled prop is originally own by touchablewithoutfeedback but you can use it with touchableopacity also. Just make disabled={true} and you are ready to go!

Have more doubts about disabled prop? Then just have a look into official docs here.

Leave a Reply

%d bloggers like this: