1<div>
2 {items.map((item,index) => <ObjectRow key={index} name={item} />)}
3</div>
1import React from 'react';
2import './App.css';
3
4
5let items=['Item 1','Item 2','Item 3','Item 4','Item 5'];
6let itemList=[];
7items.forEach((item,index)=>{
8 itemList.push( <li key={index}>{item}</li>)
9})
10function App() {
11
12 return (
13 <>
14
15 <h2>This is a simple list of items</h2>
16 <ul>
17 {itemList}
18 </ul>
19 </>
20 );
21}
22
23export default App;
24