react-native-measure-text icon indicating copy to clipboard operation
react-native-measure-text copied to clipboard

syntax error in example usage in readme

Open ktownsend-cbre opened this issue 6 years ago • 1 comments

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 });
  }

ktownsend-cbre avatar Aug 17 '18 16:08 ktownsend-cbre

I agree that.

NikiLee2016 avatar Jun 04 '19 09:06 NikiLee2016