I want to mention two issues I faced while using react-papaparse:
- Poor TypeScript type inference on children render function arguments and prop types for
CSVReader component.
- Too many
any type definition, unnecessary CSSProperties type castings and style?: any usages.
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.