Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript ParseResult Type #97

Open
thewordisbird opened this issue Aug 28, 2021 · 2 comments
Open

Typescript ParseResult Type #97

thewordisbird opened this issue Aug 28, 2021 · 2 comments
Assignees

Comments

@thewordisbird
Copy link

With headers set to true in the config for the CSVReader component, the ParseResult type for the data doesn't match the provided output when the config prop has {header: true}. This is described in "The Parse Result Object" section of the docs:

data is an array of rows. If header is false, rows are arrays; otherwise they are objects of data keyed by the field name.

but is not addressed in the type definition as the ParseResult interface only provides a data type of T[] for the ParseResult Object data and has no option for the T type of the ParseResult Object data when header is true.

@Bunlong
Copy link
Owner

Bunlong commented Nov 5, 2021

@thewordisbird It's was fixed. Please install the last version 3.18.0. Thanks!

@Bunlong Bunlong self-assigned this Nov 5, 2021
@gogog22510
Copy link

I still have this issue using 3.18.0. The return type complained by the compiler is still T[]. Any suggestion?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants