How to use the reactJS to append DOM elements with loop.
I use the way Click here
After compiler these code still get the error with :
Uncaught Error: Content.render(): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.
var Content = React.createClass({
render: function () {
var dom_content = [];
for (var i = 0; i < 3; i++) {
dom_content.push(<li className='col-xs-12 col-sm-6 col-md-4 block'><div className='box'></div></li>);
}
return dom_content;
}
});
ReactDOM.render(
<Content />,
document.getElementById('the_box')
);