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
1<tbody>
2 {[...Array(10)].map((x, i) =>
3 <ObjectRow key={i} />
4 )}
5</tbody>
6
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 }
1var rows = [];
2for (var i = 0; i < numrows; i++) {
3 rows.push(ObjectRow());
4}
5return tbody(rows);
6
1{
2 countryCodes.map(
3 ({name,code,emoji}): React.ReactElement<any> => {
4 return (
5 <Picker.Item label={emoji+' '+name} value={code} key={name} />
6 );
7},
8 )
9}
10
11use this in jsx anywhere use want to use