Hacker News new | ask | show | jobs
by dmitriid 3104 days ago
Ternary operators in JSX are valid javascript expressions. As is anything that goes into {}

All of the following is neither Javascript nor HTML:

    v-for=”x in list”
    v-if=”conditional”
    v-on:click=“function”
    v-bind:key=“something.id”
etc. etc. etc.
1 comments

I'm aware of that bit, I just think they're an ugly piece of control flow inside JSX, and they're also not a particularly versatile piece of control flow.

Especially for the else-if case - you end up with repetitive conditionals to replicate that.