1render: function() {
2 const elements = ['one', 'two', 'three'];
3 return (
4 <ul>
5 {elements.map((value, index) => {
6 return <li key={index}>{value}</li>
7 })}
8 </ul>
9 )
10}
11
1myLoopFunction() {
2 var myArray = [];
3 var i;
4 for (i = 0; i < this.state.events.length; i++) {
5 myArray[i] = (
6 <Event
7 time={this.state.events[i].time}
8 title={this.state.events[i].title}
9 />
10 );
11 }
12 return myArray;
13 }