Using Expo.FileSystem to read spreadsheet files

Below is a potential solution I find:
I don’t implement it at the end, as I found in my need (import some static data) , it’s easier to just convert xlsx file to json and import it directly.

FileSystem.readAsStringAsync(fileUri, {encoding: FileSystem.EncodingTypes.Base64}).then(b64 => XLSX.read(b64, {type: “base64”})).then(wb => { /* process the workbook here */ });

for “fileUri”, please check the document of FileSystem:

And also, in order to use {encoding: FileSystem.EncodingTypes.Base64}, expo SDK 31.0.0 or later version is needed.

for more info on this topic, pls check:

https://github.com/SheetJS/js-xlsx/blob/master/demos/react/react-native.js

for solutions for problems with upgrading from SDK 27.0.0 to SDK 32.0.0:
Problem Upgrading to SDK 31 (Cannot Find Babel Plugin ‘transform-react-jsx-source’)
[SDK32] undefined is not an object (evaluating ‘_expo2.default.KeepAwake’) #3152