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 definition are missing #37

Closed
apoorvmote opened this issue Mar 20, 2020 · 6 comments · Fixed by #38
Closed

typescript definition are missing #37

apoorvmote opened this issue Mar 20, 2020 · 6 comments · Fixed by #38
Assignees

Comments

@apoorvmote
Copy link

I chose this library over others because majority of the code is written in typescript.
When I add this to my project it gives me error

Could not find a declaration file for module 'react-csv-reader'. '/home/apoorvmote/import-export/node_modules/react-csv-reader/dist/react-csv-reader.js' implicitly has an 'any' type.
  Try `npm install @types/react-csv-reader` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-csv-reader';`ts(7016)

To recreate

  1. npx create-react-app csv-test --use-npm --template typescript
  2. npm i react-csv-reader
  3. In App.tsx just add this line import CSVReader from 'react-csv-reader'
    then you get the error mentioned above.
@nzambello nzambello self-assigned this Mar 20, 2020
@adammesa
Copy link

+1 Am also having this issue

@nzambello
Copy link
Owner

@apoorvmote @adammesa Fixed in v3.0.3 👍

@apoorvmote
Copy link
Author

@nzambello I tested it and it works better now.
If I had to be nitpicky then the parserOption is just any shape object. Which is better than before but it could be better.

@nzambello
Copy link
Owner

@nzambello I tested it and it works better now.
If I had to be nitpicky then the parserOption is just any shape object. Which is better than before but it could be better.

@apoorvmote Thank you for pointing it to me, I'm a newbie on typescript libraries.
Now typings provide full specifications for parserOptions, too.
Updated in v3.0.4

@adammesa
Copy link

@nzambello you, sir, are fast!

Thank you for all your hard work. (I am 3 days new to TypeScript and had no idea how to tackle this)

@apoorvmote
Copy link
Author

Thanks for fixing again quickly. I am also relatively new to Typescript. I just have 1 year experience with Typescript. I am not 3 days into Typescript.

If anyone else wanted strictly typed parserOption then first install npm i -D @types/papaparse only the types as dev dependancy. Then on the tsx file import { ParseConfig } from 'papaparse' this is type used for parserOption

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

Successfully merging a pull request may close this issue.

3 participants