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
363 stars 60 forks source link

Enhancement : Making of elements headless #136

Open hussamkhatib opened 2 years ago

hussamkhatib commented 2 years ago

Making Components headless to have greater control on how we can style them.

Proposed change: This is an example how this can end up. All logic is extracted in hooks and we get full control on how we style them.

const csvDownloader = useCSVDownloader();

const downloadCSV = () => {
   csvDownloader.download(data)
}

<MyCustomButton onClick={downloadCSV}>
   Download CSV 
</MyCusomButton>

Links :