私はHTMLテーブルを返すReactコンポーネントを持っています。 <Options list={item} />
生のHTMLを返す反応コンポーネント
これは、テーブルを返す機能性成分である:
const Options = (props) => {
let table = `
<table className="table table-striped table-hover ">
<thead>
<tr>
<th>#</th>
<th>Option</th>
<th>Votes</th>
</tr>
</thead>
<tbody>
`
for (let i = 0; i < props.list.options.length; i++){
table += `<tr>
<td>${i+1}</td>
<td>${props.list.options[i].option}</td>
<td>${props.list.options[i].vote}</td>
</tr>
`
}
table += `</tbody></table>`
return table;
}
しかし、私は、画面上に表示することです:
どのようにHTMLを歩んを使用して
呼び出されますブラウザでレンダリングされていませんか?
これは実際に文字列を返すためです。 –
[JSXについて学ぶ](https://reactjs.org/docs/jsx-in-depth.html)と、現在使用しているHTMLの文字列との違いをお勧めします。 –