Created
May 17, 2021 19:36
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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