Quantcast
Viewing latest article 2
Browse Latest Browse All 5

Answer by jsina for How to use TouchableNativeFeedback in React native android?

best practice to use TouchableNativeFeedback.Ripple is to check the api version of devices first, because this background type is available on Android API level 21+.

import { Platform } from 'react-native';

<TouchableNativeFeedback
  onPress={this.follow}
  background={
    Platform.Version >= 21 ?
      TouchableNativeFeedback.Ripple('rgba(0,0,0,.2)', true) :
      TouchableNativeFeedback.SelectableBackground()
  }
>

Viewing latest article 2
Browse Latest Browse All 5

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>