1function ListItem(props) {
2 // Correct! There is no need to specify the key here: return <li>{props.value}</li>;}
3
4function NumberList(props) {
5 const numbers = props.numbers;
6 const listItems = numbers.map((number) =>
7 // Correct! Key should be specified inside the array. <ListItem key={number.toString()} value={number} /> );
8 return (
9 <ul>
10 {listItems}
11 </ul>
12 );
13}
14
15const numbers = [1, 2, 3, 4, 5];
16ReactDOM.render(
17 <NumberList numbers={numbers} />,
18 document.getElementById('root')
19);