DEV Community

Discussion on: Are you giving the proper sense to React.Fragment?

Collapse
 
pcjmfranken profile image
Peter Franken

Fragments were introduced as a workaround to JSX not supporting unwrapped sibling elements.

Professional programmers should probably start by reading the docs.

Collapse
 
dmauldin profile image
Dave Mauldin

Full agree. Also, if the docs were read in this case, one would also see that the official advice is to return false ala return condition && <li>item</li> so that React immediately knows to not render anything. Not sure where the expectation that the component must return something renderable came from in this article.