react-data-export
react-data-export copied to clipboard
Typescript declarations do not work?
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

but there is no available @types/react-data-export
how can I solve it?
Thanks
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.
- In this repo, go to
types/index.d.tshere - Either copy the codes or download the file.
- Add it to your project, I added mine at
src/modules/types/react-data.export.d.ts
this should work.
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
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
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
I have the same problem 😢
Same issue here. When will get the rewritten package?
https://github.com/securedeveloper/react-data-export/issues/146#issuecomment-741631989
Answer like no