I am looking for a way of reading a text file from Google Drive. I have been able to list all the files that a user has but I'm having problem reading it.
const listFiles = (searchTerm = null) => {
setIsFetchingGoogleDriveFiles(true);
gapi.client.drive.files
.list({
pageSize: 10,
})
.then(function (response) {
setIsFetchingGoogleDriveFiles(false);
setListDocumentsVisibility(true);
const res = JSON.parse(response.body);
console.log(res.files);
setDocuments(res.files);
});
};