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

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}
/>
主站蜘蛛池模板: 巍山| 泾川县| 扎鲁特旗| 勐海县| 汶川县| 察雅县| 广元市| 高唐县| 偏关县| 乌苏市| 峡江县| 玛曲县| 彭州市| 柳林县| 托里县| 泽库县| 石首市| 汶川县| 山丹县| 乃东县| 商城县| 锦屏县| 靖西县| 图木舒克市| 淮阳县| 溧水县| 沾化县| 北辰区| 庐江县| 鄂尔多斯市| 隆尧县| 洛浦县| 安康市| 天长市| 富川| 贡觉县| 蒙山县| 山东| 云阳县| 青阳县| 九龙城区|