Instead of returning a nested element.
<div>
<div className="one">one</div>
<div className="two">two</div>
</div>
how do I just return this
<div className="one">one</div>
<div className="two">two</div>
Instead of returning a nested element.
<div>
<div className="one">one</div>
<div className="two">two</div>
</div>
how do I just return this
<div className="one">one</div>
<div className="two">two</div>
Like @Glenn Reyes mentioned, in react 16 you can do this
return [
<li key="1">One</li>,
<li key="2">Two</li>,
<li key="3">Three</li>
];
In the current version of React (v15), you can't return multiple Elements from render.
In the upcoming major version (React v16), you will be able to return arrays with multiple Elements from render
If you want to try it now, you can do so buy npm install react@next --save
or via yarn with yarn add react@next