Skip to content

Instantly share code, notes, and snippets.

@pflevy
Created May 17, 2021 19:33
Show Gist options
  • Save pflevy/2565c620fa6d8ba6a39e544f2a7d3cf3 to your computer and use it in GitHub Desktop.
Save pflevy/2565c620fa6d8ba6a39e544f2a7d3cf3 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.
import React from "react";
const MyComponent = (props) => {
return (
<React.Fragment>
<li>Grouped list item</li>
<li>Grouped list item</li>
<li>Grouped list item</li>
</React.Fragment>
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment