DEV Community

Discussion on: Stop returning NULL components

 
loopmode profile image
Jovica Aleksic

I guess so. In the end, render is performed and returns something. And execution of the render is part of the lifecycle.
The point is that react must first evaluate the empty fragment to figure out "it's nothing" as opposed it was filled with children.

Thread Thread
 
ivan_jrmc profile image
Ivan Jeremic

Yeah thinking more about it that makes sense. Need to go back and optimize 😫

Thread Thread
 
ucvdesh profile image
Daniel Silva

Yeah bro, a empty fragment also trigger a full lifecycle because of the render of the fragment, as soon as you have it, then the component exist ergo, have its own lifecycle