News for hackers. Stuff that matters.
Re:Advice on JSX Conditionals by 9wzYQbTYsAIc on Wednesday March 09, 2022 @03:19PM (#30619449)
> It doesn’t matter where the expression is placed, it’s the same if you assign it to a variable

If you separate the concern of the condition definition from the conditional rendering, by pulling the conditional’s definition into a variable, you do get enhanced portability, though.

Much easier to port between languages and frameworks if your conditional definition can be copy-and-pasted out without having to mess with untwining the previous developers expression statements.

Re:Advice on JSX Conditionals by eyelidlessness on Wednesday March 09, 2022 @05:01PM (#30620559)
I’m not sure whether I agree or disagree with this. But I do want to clarify that my intent was not to argue for or against conditional expressions in any code position, only to address the factual question of whether they constitute control flow.