I\'m using Papa Parse to parse a CSV file for Graphs. I want to store the data in React state after the file is parsed. Papa.Parse() doesn\'t return anything and results are
You need to bind the getData():
getData()
function getData(result) { console.log(result); // displays whole data this.setState({data: result}); // but gets error here }.bind(this)