Get file path for image in main bundle in react-native

Viewed 348

So I'm trying to find what the actual path to an image in my assets folder is during runtime.

I've used react-native-fs to get to the main bundle and can see my assets folder, but not sure how to actually get the path to the image inside the folder.

RNFS.readdir(RNFS.MainBundlePath + '/assets').then(response => {
  // console.log(response)
})

• Is this something that's possible in react-native? • I saw that Expo has an Assets package which makes this simple, but I'm not using Expo.

Thanks!

0 Answers
Related