Bunlong / react-papaparse

react-papaparse is the fastest in-browser CSV (or delimited text) parser for React. It is full of useful features such as CSVReader, CSVDownloader, readString, jsonToCSV, readRemoteFile, ... etc.
https://react-papaparse.js.org
MIT License
372 stars 62 forks source link

CSVDownloader and Performance #52

Closed Bunlong closed 2 years ago

Bunlong commented 4 years ago

react-papaparse v3.8.0

Draft 1

const jsonData = [
  ["firstname", "lastname", "email"],
  ["Ahmed", "Tomi", "ah@smthing.co.com"],
  ["Raed", "Labes", "rl@smthing.co.com"],
  ["Yezzi", "Min l3b", "ymin@cocococo.com"]
]

<CSVDownloader data={jsonData} target="_blank">Download</CSVDownloader>

Draft 2

const str = `Column 1,Column 2,Column 3,Column 4
1-1,1-2,1-3,1-4
2-1,2-2,2-3,2-4
3-1,3-2,3-3,3-4
4,5,6,7`

<CSVDownloader data={str} target="_blank">Download</CSVDownloader>