Я попытался papaparse для преобразования файла CSV в json, моя проблема в том, что он не получил содержимое файла, он возвращает URI файла в виде строки. Вот мой код
const chooseFile = async() => {
try {
const`enter code here` res = await DocumentPicker.pick({
type: [DocumentPicker.types.allFiles],
});
Papa.parse(res.uri, {
complete: function(results) {
console.log("Finished:", results.data);
}
}
)
console.log(
res.uri,
res.type, // mime type
res.name,
res.size
);
} catch (err) {
if (DocumentPicker.isCancel(err)) {
// User cancelled the picker, exit any dialogs or menus and move on
} else {
throw err;
}
}
}