Use React.Fragment to avoid creating useless divs
Public
30 Oct 08:44

This jsx

<React.Fragment>
  <h1>Hello World</h1>
  <p>This is paragraph</p>
</React.Fragment>

Will be compiled into this html

<h1>Hello World</h1>
<p>This is paragraph</p>

But React treats it as a single element, so you can return it from a render function.

Comments

Empty! You must sign in to add comments.