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

Not Compatible with React v17 and v18 #95

Closed moazzam-ali closed 4 months ago

moazzam-ali commented 6 months ago

I was unable to install it in my Nextjs 14 application that is using React: "^18". I can install it using --force, but doesn't sound like a good solution to me and it causes issues in my CI/CD Pipelines.

Upon inspection I found that the package is compatible with React: "^15.0.0 || ^16.0.0",

I request the owners to update the package to make it compatible with latest React Version.

markcorrea commented 5 months ago

Same here. Or if this is not going to receive any updates, any alternatives we can use instead?

ataverascrespo commented 4 months ago

@markcorrea @moazzam-ali you can use my fork of the repo, which is updated to React 18 and TypeScript. If that doesn't work for you, there are also many other alternatives that the OSS community has updated to React 18 on npm :)

moazzam-ali commented 4 months ago

@ataverascrespoI have the required functionality implemented by rendering my text as an svg and then use CSS to scale it to the container's height and width. That fulfilled my requirements for now. Will definitely check out your fork if I need this package again.