securedeveloper / react-data-export

Export dataset in react.
https://securedeveloper.github.io/react-data-export/
MIT License
179 stars 191 forks source link

Typescript declarations do not work? #146

Open komarovalexander opened 3 years ago

komarovalexander commented 3 years ago

Hi, Thanks for your work on this library. I use typescript in my project and get next issue:

I import

import ReactExport from 'react-data-export';

and get image

but there is no available @types/react-data-export

how can I solve it?

Thanks

ralphocdol commented 3 years ago

For some reason, the types in NPM package of react-data-export is different, maybe it's outdated. You have to do this yourself at least for now.

  1. In this repo, go to types/index.d.ts here
  2. Either copy the codes or download the file.
  3. Add it to your project, I added mine at src/modules/types/react-data.export.d.ts

this should work.

bikash9449 commented 2 years ago

The same is happening to me, Also even after copying it into types folder I explicitly had to move it to distr folder after deployment

OkancanCosar commented 2 years ago

i already created react-data.export.d.ts file and fill with https://github.com/securedeveloper/react-data-export/blob/master/types/index.d.ts but still getting

Could not find a declaration file for module 'react-export-excel'. 'C:/prj/node_modules/react-export-excel/dist/index.js' implicitly has an 'any' type. Try npm i --save-dev @types/react-export-excel if it exists or add a new declaration (.d.ts) file containing declare module 'react-export-excel';

is it about typescript version? File noted 2.2 but i have 4.3.x

dalthonmh commented 2 years ago

It says me:

yarn add v1.16.0
[1/4] Resolving packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/@types%2freact-export-excel: Not found".
info If you think this is a bug, please open a bug report with the information provided in "E:\\DATA\\client\\yarn-error.log".        
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command
Daalb commented 2 years ago

I have the same problem 😢

sankarkumar23 commented 1 year ago

Same issue here. When will get the rewritten package?

tranviet2010 commented 1 year ago

https://github.com/securedeveloper/react-data-export/issues/146#issuecomment-741631989

Answer like no