Categories
React Native Answers

How to change button style on press in React Native?

Spread the love

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.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *