Akila

Akila

  • NA
  • 216
  • 34k

if else condition in react native

Jan 11 2022 7:21 AM

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)