react-papaparse
react-papaparse copied to clipboard
Enhancement : Making of elements headless
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 :
- https://tanstack.com/table/v8/docs/guide/introduction#what-is-headless-ui