News for hackers. Stuff that matters.
Re:Angular vs. React – the tie breaker by xixixao on Thursday July 09, 2015 @11:02AM (#9858224)
This is such a step back, it's a completely wrong approach trying to mimick it in React:

    <ul>
      <li ng-repeat="item in items">{{item}}</li>
    </ul>
The equivalent in ES6 (which is React's preferred way to do things now):

  return <ul>
    {this.props.items.map(item => <li>{item}</li>)}
  </ul>;
It's just code! This gets better as you use a better language than JavaScript[0]:

  <ul>
    {<li>{item}</li> for item in @props.items}
  </ul>
Shorter, way more explicit, no new attributes to learn. Enjoy.

[0] https://github.com/jsdf/coffee-react

There are no comments on this comment yet.