Welcome to the Treehouse Community
Looking to learn something new?
Adrian MindakCourses Plus Student 10,877 Points
Auto shrinking text, to fit in a div, for ReactJS?
I recently rewatched a cool live coding event with Michel Jackson from React-Router (https://www.youtube.com/watch?v=ZtU7Mhf9vN8).
He is building a Calculator and I used a lot of his tips for practice and build a Calculator “myself”. I was hooked by the possibility to have a and the complexity behind the AutoShrinkingTextField. Which is pretty common for a Calculator.
I tried to copy his Code but it does not work and I was trying to find a similar solution.
ReactNative has this Stuff already as a property (https://github.com/facebook/react-native/issues/728 First Comment from the Contributor).
But it seems that React is not so easy in that case.
My question is now: Do anybody know a good jQuery free Solution for AutoShrinkText to fit a div in ReactJS?
I am also interested in Examples or cool Solutions for an auto format for currency or any other units like kilograms, fixing dots and the thousands separators.
I already looked at npm packages(https://www.npmjs.com/search?q=react%20fit%20text&page=1&ranking=optimal). I am looking for a more approved solution or tutorials, to write and understand a class in combination with refs, like Micheal did in the live coding event, by myself.
Thx so much, this is my second time I ever ask something in forums :P. I am pretty excited !!! Best Adrian