News for hackers. Stuff that matters.
Re:Advice on JSX Conditionals by Izkata on Wednesday March 09, 2022 @01:10PM (#30617959)
Or, no need to enable anything:

  {user
      ? <Logout \>
      : <Login \>
  }
Re:Advice on JSX Conditionals by hombre_fatal on Wednesday March 09, 2022 @11:33PM (#30623250)
Yes, my example is trivial, but if-else can easily outgrow the ternary. The do-expression lets you embed arbitrary statements.
Re:Advice on JSX Conditionals by couchand on Wednesday March 09, 2022 @01:15PM (#30618028)
Ok this thread just reached peak JavaScript.
Re:Advice on JSX Conditionals by christophilus on Wednesday March 09, 2022 @01:26PM (#30618168)
Ternary expressions have been around long before JavaScript was a twinkle in Brandon Eich’s eyes.
Re:Advice on JSX Conditionals by 9wzYQbTYsAIc on Wednesday March 09, 2022 @02:34PM (#30618975)
Just modern ECMA Script, not peak JavaScript. ES6 and React Hooks have fully sublimated the web development landscape.