News for hackers. Stuff that matters.
Re:What should go into JSX 2.0? by _betty_ on Sunday October 16, 2016 @02:51PM (#12720259)
I'd love for them to adopt something similar to Razor (Microsoft server side html engine)

note: i've changed your example to show code inside html tags, i'm aware it does something different to yours.

conditionals

  <div>
    @if(cond1 && cond2) {
      <div>foo</div>
    }
  </div>

loops

  <div>
    @for(var i in collection) {
      <div></div>
    }
  </div>

variables

  <div>
    @variable
  </div>

ternary/longer statement

  <div>
    @(variable ? 1 : 2)
  </div>
Re:What should go into JSX 2.0? by tmzt on Sunday October 16, 2016 @07:30PM (#12721684)
The one negative thing I've found with Razor is the ambiguous start and end of statements or expressions vs html. Sometimes a @ is required before a statement and sometimes its a syntax error, conversely statements and and expressions may be rendered as text if they follow html with a @. I think jsx's approach is clearer.
Re:What should go into JSX 2.0? by _betty_ on Monday October 17, 2016 @09:23PM (#12731283)
admittedly there is the occasional moment I hit where I need an extra @ or @: so it's not perfect, but I have much less issue reading that format than the { true && <element /> } syntax, also think @if is a lot nicer than <if>.

Maybe just a personal thing.