开发者社区 问答 正文

#React 如何在React中写评论?

#React 如何在React中写评论?

展开
收起
因为相信,所以看见。 2020-05-07 17:04:35 775 分享 版权
1 条回答
写回答
取消 提交回答
  • 阿里,我所有的向往

    React / JSX中的注释类似于JavaScript Multiline注释,但用大括号括起来。

    单行注释:

    <div>
      {/* Single-line comments(In vanilla JavaScript, the single-line comments are represented by double slash(//)) */}
      {`Welcome ${user}, let's play React`}
    </div>
    
    

    多行注释:

    <div>
      {/* Multi-line comments for more than
       one line */}
      {`Welcome ${user}, let's play React`}
    </div>
    
    
    2020-05-07 17:05:22
    赞同 展开评论
问答分类:
问答标签:
问答地址: