Reputation: 183
I want to read and display the text contents from a .txt file which is saved locally to the app build with react native.
The text is huge hence i cant hard code it to the code.
Upvotes: 6
Views: 9482
Reputation: 1860
I think you are using Expo,
You can use expo filesystem https://docs.expo.io/versions/latest/sdk/filesystem
Which is a native wrapper for platform specific system file management methods. You can read and change files managed in your app's domain.
For Eg:
Expo.FileSystem.readAsStringAsync(fileUri)
Upvotes: 3