0
votes

I have an array of image URI.

["file:///data/user/0/com.app.outlet/cache/react-native-image-crop-picker/22536474236950.png","file:///data/user/0/com.app.outlet/cache/react-native-image-crop-picker/22583225016770.png"]

I want to render the image component based on the length of the array and show and show all the images. How can I do it in react native

2

2 Answers

1
votes

I believe this will help you and please read first how to ask question…

   var array =   ["file:///data/user/0/com.app.outlet/cache/react-native-image-crop-picker/22536474236950.png","file:///data/user/0/com.app.outlet/cache/react-native-image-crop-picker/22583225016770.png"]

      array.map((x)=>{
        return(<Image source={x || whatever you want } style={{xx:"xx"}} />)
      })
0
votes

if you have image in array you can use map function and display in image component

data = ['a.png',b.png']

data.map((item,index)=>{

like that it is just demo example