1.0.3 • Published 4 years ago

@mystify/balancetext v1.0.3

Weekly downloads
4
License
MIT
Repository
-
Last release
4 years ago

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>

}
1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago