Sometimes, we want to change button style on press in React Native.
In this article, we’ll look at how to change button style on press in React Native.
How to change button style on press in React Native?
To change button style on press in React Native, we set the underlayColor of the TouchableHighlight component.
For instance, we write
<TouchableHighlight style={styles.btn} underlayColor="yellow" />;
to set the underlayColor to 'yellow' to make the background color yellow when we tap the region.
Conclusion
To change button style on press in React Native, we set the underlayColor of the TouchableHighlight component.