4 ms·
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>
by xixixao 11y ago
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 https://github.com/jsdf/coffee-react