I've been writing Coffeescript/CJSX and this is valid syntax:
<div>
<input type={if @state.name == "Test" then "checkbox"}/>
</div>
How do I do the same for plain Javascript? There is no if...then
clause and I don't think I can do inline if
checks like I can in Coffee?
Valid!
}`. But i think you're right in this case that the ternary is correct. – inostia Aug 24 '16 at 18:27