2
Answers

if else condition in react native

Akila

Akila

3y
652
1

I want to display image from the db.if there is no data then dispaly default image

 data.length==0?

      <View style={styles.slide}>

      <Image

        source={defaultimage}

        style={styles.image}

        resizeMode="center"

       />

    

    </View>: 

      <View style={styles.slide}>

          <Image style={styles.image} source={feedprofileimage} resizeMode='contain' />

                 </View>

    );

issue is the data lenth was 0.but did not display the default image

Answers (2)