I cannot figure out how to parse a CSV file into an array which can be displayed in React JS.
I tried using PapaParse and react-papaparse, but neither allowed me to return the csv as an array.
This is essential in React JS because the way components are created is by returning them from a function.
In the examples for Papaparse and react-papaparse, they merely write the array to the console, but you cannot return the value of the array from the function because they use their complete
keyword to read the array and call the handler function rather than simply allowing you to parse the CSV to an array which can be stored in a variable.
Please provide a working example of how I can parse a CSV file to an array which I can return from a function and thus add to my react virtual dom.