Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - /MyApp
- - /ios
- - data.json
- - index.ios.js
- {
- "words": [
- {"word": "xxx", "done": false} // and more...
- ]
- }
- var RNFS = require('react-native-fs');
- // create a path you want to write to
- var path = RNFS.DocumentDirectoryPath + '/test.txt';
- // write the file
- RNFS.writeFile(path, 'Lorem ipsum dolor sit amet', 'utf8')
- .then((success) => {
- console.log('FILE WRITTEN!');
- })
- .catch((err) => {
- console.log(err.message);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement