Search code examples
react-nativereact-native-image

Setting path to image source in reactnative


<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.


Solution

  • I found the answer. Please use following type for that

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

    Thank You