1<div>
2 {items.map((item,index) => <ObjectRow key={index} name={item} />)}
3</div>
1
2Count wiil be my number value = 10;
3
4
5
6const {Count} = props;
7 let list = Count=== undefined?10:Count;
8 let jsx = [];
9 for (let index = 0; index < list; index++) {
10 jsx.push('index'+index)
11 }
12
13 return (
14 <View>
15 <Text>{jsx.length}</Text>
16 {jsx.map(()=>(
17 <Text>{index}</Text>
18 ))
19 }
20 </View>
21
22 )
23
24==========================
25
26
27if you try like this
28jsx = new Array(list);
29
30this will create array but jsx is not working
31
32try your self
33
1let App = () => {
2 return <ul>{Array.from(Array(10), (e, i) => {
3 return <li key={i}>{i}</li>
4 })}</ul>
5}
6