DEV Community

Discussion on: Stop returning NULL components

Collapse
 
ucvdesh profile image
Daniel Silva

Hmmm, don't actually have a documented benchmark. But I've been seeing this a lot through multiple projects I worked on, specially on forms.

But I think is a great idea to add benchmarks, thanks! I will do it for sure!

Collapse
 
codyseibert profile image
Cody Seibert • Edited

Just wondering. I’ve never returned null in my react apps. I always just do {myBoolean && MyComponent()}. I can’t insert carot symbols but you get the point.

Thread Thread
 
ucvdesh profile image
Daniel Silva

Exactly! This is a correct conditional render, because MyComponent does not render unless myBoolean is true