DEV Community

Discussion on: React - how to render adjacent JSX elements

Collapse
 
lfbergee profile image
Leiv Fredrik Berge • Edited

The performance difference is probably negligible, but the semantics is not. As I see it, it's the main differential between div and fragment. Often the parent component is semantically related to the children.

<ul>
  <div>
    <li>a child</li>
    <li>another child</li>
  </div>
</ul>

That's no good, and fragment solves this.