react-native-fs icon indicating copy to clipboard operation
react-native-fs copied to clipboard

screen freezes on Android when reading file

Open jadfls opened this issue 4 years ago • 3 comments

Hi,

when running following code on Android the UI freezes while reading the file.

console.log("LOAD from file");
const contents = await RNFS.readFile(RNFS.DocumentDirectoryPath+"/myfile.data");

The file is rather large (10MB). I read the note on readFile:

Note: you will take quite a performance hit if you are reading big files

But how can I run the reading in the background?

In iOS the screen does not freeze or only freezes for a short period as the reading happens much faster.

jadfls avatar Nov 20 '20 14:11 jadfls

same here

Yoshihide-Nishimoto avatar Jul 07 '21 02:07 Yoshihide-Nishimoto

Is there any solution for this?

hafizMDM avatar Feb 12 '22 17:02 hafizMDM

same here

arshiyanaz avatar Jan 07 '24 17:01 arshiyanaz