react-native-measure-text
react-native-measure-text copied to clipboard
syntax error in example usage in readme
The following is incorrect in the readme example usage:
async componentDidMount() {
const heights = await MeasureText.heights({(
texts, /* texts to measure */
width, /* container width */
fontSize,
fontFamily /* fontFamily is optional! */
);
this.setState({ heights });
}
In particular, the extra parenthesis at the end of the 2nd line, and missing curly brace to close the object being passed to the method.
Corrected version:
async componentDidMount() {
const heights = await MeasureText.heights({
texts, /* texts to measure */
width, /* container width */
fontSize,
fontFamily /* fontFamily is optional! */
});
this.setState({ heights });
}
I agree that.