Skip to content

Instantly share code, notes, and snippets.

@RomikMakavana
Created February 20, 2023 05:27
Show Gist options
  • Save RomikMakavana/23d71e4ca8a57dab4f398a124baaeb9c to your computer and use it in GitHub Desktop.
Save RomikMakavana/23d71e4ca8a57dab4f398a124baaeb9c to your computer and use it in GitHub Desktop.
import RNFS from 'react-native-fs';
const filePath = RNFS.DocumentDirectoryPath + '/example.txt';
RNFS.exists(filePath)
.then((exists) => {
if (exists) {
console.log('File exists');
} else {
console.log('File does not exist');
}
})
.catch((error) => {
console.log(error);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment