Skip to content

Instantly share code, notes, and snippets.

@pflevy
Created May 17, 2021 19:36
Show Gist options
  • Save pflevy/38570ae49e1d0136fbbe55741981c348 to your computer and use it in GitHub Desktop.
Save pflevy/38570ae49e1d0136fbbe55741981c348 to your computer and use it in GitHub Desktop.
The best solution is to apply React Fragments when a wrapper element is required since a React Fragment doesn't render an element to the DOM. In this example, the short syntax is used instead of the full syntax.
import React from "react";
const MyComponent = (props) => {
return (
<>
<li>Grouped list item</li>
<li>Grouped list item</li>
<li>Grouped list item</li>
</>
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment