Make a Blobhelp wanted
Description
Not sure why I am getting a server error on download. I am working in React. The way I have this written it says, "saveAs is declared but not used. No unused vars" as a warning in the console. When I fire the click handler it attempts to download, but throws an error.
import FileSaver, { saveAs } from 'file-saver'
handleClick = (event) => {
console.log("this.newOrder = ", this.newOrder)
const csv = Papa.unparse(this.newOrder)
console.log("csv = ", csv)
FileSaver.saveAs(csv)
}
_Uncaught TypeError: Cannot read property 'name' of undefined
at Function.a [as saveAs] (FileSaver.min.js:47)
at App._this.handleClick (App.js:85)
at Button.onClick (reactstrap.es.js:1115)
at HTMLUnknownElement.callCallback (react-dom.development.js:147) etc etc_