malte-wessel/react-textfit

Problem with TypeScript

kayoroxa opened this issue · 3 comments

image
"npm i --save-dev @types/react-textfit" Doesn't work..

Commenting as I've had the same issue and have been unable to resolve.

basically if its lacks of types just make your own types or just declare them as 'any' for now:

  1. create file react-textfit.d.ts in your typings folder with should be configured with your tsconfig
  2. declare module 'react-textfit';
    save and thats all
const Textfit=  require('react-textfit');

and install npm i --save @types/node
and wait until ts is supported is what i do always when i intergrate jsx component without definition type.