JavaScript
638
Вклад в тег
await Todo.find({}).lean()
data = [........]
render() {
return (
<>
{ data.map(x => <MyComponent prop1={x.prop1} prop2={x.prop2} />) }
</>
)
}
data = [........]
render() {
const components = []
for(let i = 0; i < data.length; i++) {
const x = data[i]
components.push(<MyComponent prop1={x.prop1} prop2={x.prop2} />)
}
return (
<>
{ components }
</>
)
}
arr = [[11,22], [33,44]]
console.log ( arr.flat() )