Hacker News new | ask | show | jobs
by satvikpendem 21 days ago
For 1, you're supposed to break up more complex logic like that into functions and variables, so that acts as a forcing function which works as intended. For 2, 99% of HTML is just fine, just className would be different but it's not a big deal in practice.
1 comments

I’m not talking about complex logic. Because simple conditions, iteration or switch statements are not supported with classic control flow.
That's complex logic. You shouldn't be switching on the UI layer like that.