Quantcast
Channel: How to use TouchableNativeFeedback in React native android? - Stack Overflow
Viewing all articles
Browse latest Browse all 5

How to use TouchableNativeFeedback in React native android?

$
0
0

I am getting warnings while using this component. Trying to use this component as a button. I tried require('TouchableNativeFeedback') but no use. I also tried to npm install TouchableNativeFeedback, but failed. How should it be incorporated in my react native android code?

 {
    var TouchableNativeFeedback= require('TouchableNativeFeedback');
    var Button= require('react-native-button');
    var {

      AppRegistry,
      StyleSheet,
      Text,
      View,
      Image,
      TouchableNativeFeedback,

    } = React;

    var AwesomeProject = React.createClass({
      render: function() {

        return (

          <View style={styles.container}>

            <Text style={styles.welcome}>
              My first App
            </Text>
            <Text style={styles.instructions}>
               we should get started
            </Text>
            <Text style={styles.instructions}>
                Nice!!
            </Text>
          <Image source={require('./abc.png')} style={styles.img} >
          <Text style={styles.welcome}> Inside an image! </Text>
          </Image>
          <TouchableNativeFeedback
            style={styles.img} >
              <View>
              <Text style= {styles.instructions}> 
              Button! 
              </Text>
              </View>
          </ TouchableNativeFeedback>     
          <Button style={styles.img} onClick="this.butclick">
          <View>
          <Text style={styles.instructions}>
          This is a Button 
          </Text>
          </View>
          </Button>


          </View>

        );
      }
    });

}

Viewing all articles
Browse latest Browse all 5

Latest Images

Trending Articles





Latest Images