What if you consider it as ‘only returns a data structure that requests the rendering of <Anything /> if someBool is true’?
If you write
console.log(someBool && “anything”)
Are you altering the control flow because the console window will call a different bit of font evaluation code to render “anything” instead of “false”?
Or are you just conditionally evaluating an expression that results in different data that causes different downstream effects?
Evaluating <Anything/> doesn’t do anything. It doesn’t make any DOM elements. It doesn’t trigger any useEffects. It just returns an object that has the potential to be hooked into a react renderDOM lifecycle to provide further instructions on what the DOM should look like and what other core should run.
I already responded down thread because I didn’t see this comment first. But I’ll add that your console log example is more analogous to the JSX control flow question as:
If you write
Are you altering the control flow because the console window will call a different bit of font evaluation code to render “anything” instead of “false”?Or are you just conditionally evaluating an expression that results in different data that causes different downstream effects?
Evaluating <Anything/> doesn’t do anything. It doesn’t make any DOM elements. It doesn’t trigger any useEffects. It just returns an object that has the potential to be hooked into a react renderDOM lifecycle to provide further instructions on what the DOM should look like and what other core should run.