mardi 1 juin 2021

Adding Custom Type Definitions for Existing Libraries

Hi I am trying to add custom type definitions for react-star-ratings, i followed the typescript documentation and for the time being I wanted to have a quick and dirty solution just to get the feature working, however it is not working and still give me error

Could not find a declaration file for module 'react-star-ratings'. 'my_dir/.yarn/cache/react-star-ratings-npm-2.3.0-24c4488f30-0180c8389a.zip/node_modules/react-star-ratings/build/index.js' implicitly has an 'any' type.
  Try `npm install @types/react-star-ratings` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-star-ratings';`  TS7016

This is my code enter image description here




Aucun commentaire:

Enregistrer un commentaire