If I have a state like so:
state = {
Data: [
{
inputArr: [1, 2, 3],
},
{
inputArr: [1, 2, 3],
},
{
inputArr: [1, 2, 3],
}
]
};
and I want to make a table from the input Arr so that I will have 3 rows 3 cols and it will be in order, 123,123,123
I thought about double map but it doesn't work, is there a better way?
const test=this.state.data.map( (val)=>{
val.map( (val2)=>{
<tr>
return (
<th> val2 </th>
)
}
</tr>
}
mapthough, alsoval2should be between curly brackets. Let me know if that works.val.inputArrinstead ofval, and also the opening of thetrtag should be outside the map. Try this: codesandbox.io/embed/q8zl5p9x5q