DEV Community

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

Collapse
 
leischj profile image
leischj • Edited

I'm so confused. The title of the article says professionals never return "React.Fragment" but by the end of the article you have a component (EmptyList) that returns "React.Fragment" Does this mean you're not a professional?

In your first edit you have a comment to point out the added complexity, but the final edit has a ton of needless complexity, but is missing that comment.

Returning null for an empty list is perfectly testable, acceptable, and most importantly, simple. All things being equal, I'll opt for simplicity.