News for hackers. Stuff that matters.
Re:Why we chose Vue.js over React by insin on Sunday December 11, 2016 @12:13PM (#13151967)
This is how I've come to write that in React, after giving up on attempting to find a consistent way to write ternaries which I would find acceptable when revisiting them (it just never happened):

    let Home = ({location}) => <div>
      <h2>HELLO</h2>
      <p>Duis a turpis sed lacus dapibus elementum sed eu lectus.</p>
      {!location.query.home && <p>No home query was specified.</p>}
      {location.query.home && <p>You specified a home query: {location.query.home}</p>}
    </div>
I usually put all the possible negative cases first because outside of micro-snippets they tend to be short and sweet compared to the positive condition.

There are no comments on this comment yet.