malte-wessel / react-textfit

React component to fit headlines and paragraphs into elements
http://malte-wessel.github.io/react-textfit/
MIT License
469 stars 143 forks source link

Problem with TypeScript #68

Open kayoroxa opened 3 years ago

kayoroxa commented 3 years ago

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

jess-maldonado commented 3 years ago

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

ceboola commented 3 years ago

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
c0ncentus commented 3 years ago
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.