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

TypeScript Improvements and Refactoring on CSVReader | style object type refactoring #149

Open berkinanik opened 1 year ago

berkinanik commented 1 year ago

I want to mention two issues I faced while using react-papaparse:

I have a fix proposal which includes updating useCSVReader by rewriting many props and type definitions and refactoring all the use cases regarding those updates. Also, updating examples on styling the CSVReader and removing style type castings.

With this properly typed CSVReader component and useCSVReader hook, the component itself and its render children function have proper type inference. Many unnecessary explicit type definitions can be removed. This way typescript support is meaningful since there are no more any type usage in returned component from the useCSVReader hook.

berkinanik commented 1 year ago

150 includes further explanation and screenshots of fixed things and shows usage.