1render() {
2 const myArray = [];
3 return <>
4 {myArray.map(item => {
5 return (<Element>
6 {item}
7 </Element>);
8 });}
9 </>
10}
1You need to pass an array of element to jsx.
2The problem is that forEach does not return anything (i.e it returns undefined).
3So it's better to use map because map returns an array:
4
5***