CraZyDroiD
CraZyDroiD

Reputation: 7105

react-csv downloads a file without extension

i'm using react-csv in my project which is developmed using a windows machine. Everything works perfectly except my data is downloaded to a file without a extension. If i open the file in excel, the data is there. Only issue is it does not download in the correct file format. This is not an issue in macOs and it's there only in windows. How can i fix this issue or can you recommend me any other good library to use for this.

            <CSVLink
              data={buyerActivityBidData}
              headers={headers}
              filename="myfile.csv">
             
                Export as CSV
              
            </CSVLink> 

link : https://github.com/react-csv/react-csv

Upvotes: 1

Views: 771

Answers (1)

Labrador
Labrador

Reputation: 497

the prop "filename" must be enclosed between braces filename={"myfile.csv"}

   <CSVLink
              data={buyerActivityBidData}
              headers={headers}
              filename={"myfile.csv"}>
             
                Export as CSV
              
   </CSVLink>

Upvotes: 1

Related Questions