Hi friends. I am a new developer and have started using Airtable as a database for personal project with React, and I wanted to ask what are your thoughts on fetching data from Airtable’s API in my client-side application. Do you think it’s better to fetch the data using Axios or use the base().select()
pattern from Airtable library?
For React specific:
I don’t understand how to return the data with the Airtable method
const useCharacters = () => {
const base = new Airtable({ apiKey }).base(baseId);
// returns undefined
return base("Characters")
.select({
view: "Main View",
})
.eachPage(
function page(records, fetchNextPage) {
records.forEach(function (record) {
return record.fields
});
fetchNextPage();
},
function done(err) {
if (err) {
console.error(err);
return;
}
}
);
};