反应JSX风格指南

时间:2016-02-26 22:43:37

标签: reactjs coding-style react-jsx

jsx的标准样式是什么?特别是当HTML与js交织在一起时。返回正确位置后的括号是什么?任何人都知道任何好的格式化程序都不会弄乱一切吗?

render: function(){
    return (
      <li>
        <input id={this.props.id} type="checkbox" />
        <label htmlFor={this.props.id}>{this.props.tag}</label>
      </li>
    );
  }

2 个答案:

答案 0 :(得分:3)

我喜欢使用Airbnb code style 使用Web Storm Editor为jsx语法提供了很好的支持。

注意:您可以从message = null

自动在Web Storm中应用Airbnb样式
Settings->Code Quality

答案 1 :(得分:2)

相关问题