官术网_书友最值得收藏!

Multi-properties

A common problem in writing JSX comes when an element has multiples attributes. One solution is to write all the attributes on the same line, but this would lead to very long lines that we do not want in our code (see the following section for how to enforce coding style guides).

A common solution is to write each attribute on a new line, with one level of indentation, and then align the closing bracket with the opening tag:

  <button 
foo="bar"
veryLongPropertyName="baz"
onSomething={this.handleSomething}
/>
主站蜘蛛池模板: 隆化县| 邵阳市| 庄浪县| 西青区| 从化市| 大邑县| 乐东| 南京市| 井研县| 会东县| 通渭县| 永德县| 巴中市| 景谷| 故城县| 疏附县| 耒阳市| 胶南市| 府谷县| 清远市| 正镶白旗| 苍山县| 兴隆县| 筠连县| 大丰市| 伊吾县| 安溪县| 从化市| 旬邑县| 浮梁县| 葵青区| 蓬溪县| 庄河市| 高雄市| 平阳县| 毕节市| 凤翔县| 松江区| 孟州市| 白银市| 穆棱市|