I have an array of objects ("array"), each containing other arrays of objects.
[
{
name: "Object 1",
question: [{value: "This", type: "text"}, {value: "is", type: "text"}, {value: "1", type: "number".]
answer: [{value: "Answer", type: "text"}, {value: "is", type: "text"}, {value: "1", type: "number".]
},
{
name: "Object 2",
question: [{value: "This", type: "text"}, {value: "is", type: "text"}, {value: "2", type: "number".]
answer: [{value: "Answer", type: "text"}, {value: "is", type: "text"}, {value: "2", type: "number".]
},
]
In React, I'd like to render out the below:
<Typography>This</Typography><Typography>is</Typography><Number>1</Number>
<Typography>Answer</Typography><Typography>is</Typography><Number>1</Number
<Typography>This</Typography><Typography>is</Typography><Number>2</Number>
<Typography>Answer</Typography><Typography>is</Typography><Number>2</Number
I have tried the below, but can't work out why some of it won't map correctly.
array.map(snippet => {
snippet.question.map(question => {
return something here;
})
EDITED AS FORGOT A LEVEL OF OBJECTS