Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

How can i copy bundle file to document directory in react native

$
0
0

I have json file in my bundle. I want to copy file to document directory.

   var path = RNFS.DocumentDirectoryPath +'/data.json'; RNFS.copyFile(`${RNFS.MainBundlePath}/assests/resource/data.json`, path)    .then(() => {        console.log('FILE COPIED');    })    .catch((err) => {        console.log(err.message);    });The file “data.json” couldn’t be opened because there is no such file.

Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>