React native render array of components code example
Example 1: react create array
const numbers = [1, 2, 3, 4, 5];
const doubled = numbers.map((number) => number * 2);console.log(doubled);
Example 2: react loop through array
this.items = this.state.cart.map((item, key) => <li key={item.id}>{item.name}</li>);