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

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}
/>
主站蜘蛛池模板: 台湾省| 巧家县| 丹凤县| 余庆县| 临湘市| 松阳县| 西昌市| 田阳县| 民勤县| 泽普县| 漳浦县| 施秉县| 万州区| 内乡县| 峨眉山市| 东莞市| 金塔县| 库伦旗| 兴隆县| 宾阳县| 潍坊市| 绥中县| 石柱| 应用必备| 普兰店市| 安龙县| 儋州市| 昆山市| 闻喜县| 迭部县| 荣成市| 沙河市| 彭山县| 东乡族自治县| 西充县| 银川市| 和平县| 基隆市| 新余市| 洛浦县| 自治县|