I am new to React.js. I am trying to bind data arrays. I am looking for the equivalent of ng-repeat, but i can\'t find it inside documentation.
e.g:
var
To perform the same task as ng-repeat in React you just need to think natively. Under the hood ng-repeat is just using a native Javascript iterator. You can use the same sort of native iterator directly in React. For example, I`ll use Array.map:
var RepeatModule = React.createClass({
getInitialState: function() {
return { items: [] }
},
render: function() {
var listItems = this.props.items.map(function(item) {
return (
-
{item.name}
);
});
return (
{listItems}
);
}
});
I got the above example from http://angulartoreact.com/ng-repeat-react-equivalent . The site has more examples of React equivaents to Angular directives.