I have a React component that returns a HTML table.
Invoked using: <Options list={item} />
This is the functional component that returns the table:
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;
}
But what I see on screen is:
How come the HTML is not being rendered by the browser?
