DEV Community

Discussion on: A Clean Way to Conditionally Render Components

Collapse
 
hvolschenk profile image
Hendrik Volschenk

I agree with @lukeshiru - This solution is really expensive. If you want to do this I would highly suggest you use a render prop.

Collapse
 
anxiny profile image
Anxiny • Edited

Thanks for the feedback.
I don't think is good idea to put heavy task in the render return anyway so the performance does not suffer much by having a If wrappers.

If you have a case that may cause performance issue, please let me know