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

Imperative resize #82

Open ShaMan123 opened 3 years ago

ShaMan123 commented 3 years ago

I am facing a need to force a recalculation on Textfit. It could be nice if Textfit exposes a ref with a method fitText or something of the sort.

Current Workaround

window.dispatchEvent(new CustomEvent('resize'));
nfts2me commented 1 year ago

+1 Facing the same issue. It would be great to have a method to force the recalc.