Aditia Dananjaya
Aditia Dananjaya

Reputation: 111

Error RCTImageView

i found error in react native. if i need show my image from json what must i do?

enter image description here

<View>
  <Image style={styles.logo} source={{uri : rowData.produk_gambar}}  />   
</View>
                

what wrong guys? this is my code for image

my json respone

Upvotes: 0

Views: 675

Answers (1)

Irfan Ali
Irfan Ali

Reputation: 2258

Update your code like below.

<View>
  <Image style={styles.logo} source={{uri : rowData.produk_gambar.length > 0 ? rowData.produk_gambar[0]['url'] : null }}  />   

and URL should be network url.

Upvotes: 1

Related Questions