I am trying to render a very simple table with react, but it complains bitterly:
"Invariant Violation: Table.render(): A valid ReactComponent must be returned. You may have returned undefined, an array or some other invalid object."
Here's the definition:
var Table = React.createClass({
render: function() {
return
(<table class="table table-striped">
<thead>
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
</thead>
<tbody>
<tr>
<td>One</td>
<td>Two</td>
</tr>
<tr>
<td>One</td>
<td>Two</td>
</tr>
</tbody>
</table>);
}
});
It is a single element returned, the HTML is valid, so I am not sure what the problem is. Does anybody know what is the issue?
class(it should beclassName). My suggestion is to take a look at the generated code (if using a transpilation process, and not the browser JSX tool). This error raises when: github.com/facebook/react/blob/…