You’re not able to use node’s fs because it is part of nodejs environment . As you surely know your application code is not running on nodejs but rather directly on your smartphone (besides debug mode but even there you cannot use node’s fs package).
Read moreHow do you get file from path in React Native?
“get file from path react native” Code Answer
Read moreHow do I add files to React Native app?
Getting started
Read moreHow do you read a file in React Native?
below code is about how to read the file by react-native-fs on RN(React Native) project. … // typescript style import * as RNFS from ‘react-native-fs’; … // readFile(filepath: string, encoding?: string) RNFS. readFile(filePath, ‘ascii’). then(res => { … }) .
Read moreHow do you write in a file in react?
If you want to write to a file, you would need to send an API request from your browser / React to a server and have that server write to the file system . Additionally, as pointed out by Huy Nguyen, it’s possible to write to the clients file system from the browser but that is going to be private to that user.
Read more