React Native TouchableHighlight - React Native

What is React Native- TouchableHighlight?

We had mentioned touchable components in one of our earlier sections. This tutorial will explain you how to use TouchableHighlight component.

Step1 - Create File

We had already done this in our earlier sections. We will be creatingsrc/components/home/TouchableHighlight.js file.

Step 2 - Logic

Logic is a container component. We pass buttonPressed function as a prop.

src/components/home/HomeContainer.js

Example

Step 3 - Presentation

Presentation component is our button. underlayColor will be visible when button is pressed.

src/components/home/TouchableHighlightExample.js

Example

We can press the button to view the red color.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

React Native Topics