Setting path to image source in reactnative

279 Views Asked by At
<Image
          source={require(`../${item.image}`)}
          resizeMode="cover"
          style={styles.cardImg}
                     
   />       

local images folder path => ../media/products/four.jpg

api response => "image":"media/products/four.jpg",

I want to render {item.image} but can't access the local images folder path.

1

There are 1 best solutions below

0
On BEST ANSWER

I found the answer. Please use following type for that

source={{uri:BaseUrl+item.image}}

Thank You