13
以下の表のクラス名を(JSXの一部として)定義しました。
<table class="table">
JSXノードでクラスを指定する方法は?
その表示クラスがテーブルに設定されていない一度しかし:
var SearchResult = React.createClass({
render: function(){
return (
<table class="table">
<thead>
<tr>
<th>Name</th>
<th>Address</th>
</tr>
</thead>
<tbody>...</tbody>
</table>
);
}
});
代わりに表は、Chromeの<table data-reactid=".0.1.0.0">...</table>
として示す - >要素を検査します。
done-JSX)では、JSXは事前処理されているため、予約語は実際に動機付け要素にはなりません。 "Ben Alpert、React core team"から:*私たちは確かにそれを反対にしていたかもしれません。私はしばらくそれについて主張しました。まず、HTMLプロパティ(el.className =。 ..')可能な場合は、属性( 'el.setAttribute( 'class'、...)')などとは異なります。 – ruffin