trauma
trauma

Reputation: 322

React JS component should return another components without wrapper

I have a component which should return html elements and another components without wrapper.

var Group = React.createClass({
render: function() {
return (<tr><td>blablabla</td></tr>{this.props.arrayOfComponents});
}
});

How can I do this?

After ReactJS render I should receive next:

<table>
<tr><td>blablabla</td></tr>
<tr><td>component1</td></tr>
<tr><td>component2</td></tr>
...
<tr><td>component100</td></tr>
</table>

Upvotes: 2

Views: 480

Answers (1)

kat
kat

Reputation: 5950

in React, the render method must return only one valid React component. You cannot return multiple things at once.

Upvotes: 1

Related Questions