Reputation: 111
i found error in react native. if i need show my image from json what must i do?
<View>
<Image style={styles.logo} source={{uri : rowData.produk_gambar}} />
</View>
what wrong guys? this is my code for image
Upvotes: 0
Views: 675
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