@mystify/balancetext
v1.0.3
Published
A ripoff of balancetext by Randy Edmunds to customize to my own needs
Downloads
1
Readme
Usage:
import balanceText from "@mystify/balancetext";
To have the library load all the elements with the "balance-text" class name call "balanceText" in the did mount. I found that I have to update the watched elements after the mount to make sure that it picks up and adjusts the elements after the first render
componentDidMount() {
balanceText();
requestAnimationFrame(()=>balanceText.updateWatched());
}
render() {
// add the class name "balance-text" to your component to make it work
return <span className="balance-text">This is my text</span>
}