对于通过设置值“返回”的void方法,JSDoc3中应使用哪些标签?

时间:2019-06-03 16:36:38

标签: reactjs documentation jsdoc es6-class jsdoc3

我正在使用JSDoc3在React Component中记录方法。因为我正在使用React Components,所以所有“传入”该方法的值都是通过props进行的,而“返回”值实际上是一个已设置的属性。

什么是正确的标签?

  /**
   * updateRows
   *
   * @this Row
   * @property {string[]} data - array of strings to be made into rows of text elements.
   * @returns {JSX[]} JSX element array of rows to be rendered.
   */
  updateRows() {
    const {data} = this.props;

    let arr = data.map((d, i) => {
      return(
        <text key={i}>
         {d}
        </text>
      );
    });

    this.rows = arr;
  }


我想清楚地表明,该方法要求“数据”属性具有输入,并且它创建了一个可以访问的输出数组,但目前看来它返回了所述数组,但没有。

>

0 个答案:

没有答案