I want to convert a string to a text file on the same side of the client(App) and download it to my phone. How can I do this?
You can use react-native-fs for this task. It provides native filesystem access for react-native.
var RNFS = require('react-native-fs');
var path = RNFS.DocumentDirectoryPath + '/test.txt';
// write the file
RNFS.writeFile(path, 'your text comes here', 'utf8')
.then((success) => {
console.log('FILE WRITTEN!');
})
.catch((err) => {
console.log(err.message);
});