component (react-csv) not downloading with a .csv extension

I’m on linux using chrome. I have a standard CSVDownload component. It does download data and it is separated by commas, but it’s not appending a “.csv” to the end of my file name.

Using CSVLink will not work in this case for complicated reasons.

The file name looks something like this: “c0666246-8c08-43c5-8fd2-3180faea0b4c”.

Code for the CSVDonwload wrapper:

 const DownloadCsvButton = () => { if (csvData.length === 0) { return ( <Button variant="ghost" status="info" onClick={() => { const tableData = isChecked(); if (tableData.length === 0) { toast.error("Check one or more rows to download as .CSV"); } setCSVData(tableData); }} > <DownloadCsvLinkContent> <IconFileDownload /> Download as .CSV </DownloadCsvLinkContent> </Button> ); } else { const tableData = csvData; setCSVData([]); return <CSVDownload filename="sifter_results" data={tableData} />; } }; 

Any ideas why it’s not appending .csv? I’m not worried about naming the file manually, it’s just an annoying issue.

submitted by /u/Jdbkv5
[link] [comments]