I am a getting a json object as a response and console log shows the response like this
MyFormName: Array(5)
0: {question: "Q1", type: "star"}
1: {question: "Q1", type: "star"}
2: {question: "Q1", type: "star"}
3: {question: "Q1", type: "star"}
4: {question: "Q1", type: "star"}
How can i map through this object so i can show data in each object?
I have tried something like this. I have my json object in a state fullForm and tried the following approach
return Object.keys(this.state.fullForm).map((item, key) => {
return (
<div className="overflow_hidden" key={key}>
<div>{key + 1}</div>
<div>{item.question}</div>
</div>
)
});
But here the value i get for item is MyFormName. I want to map the objects in MyFormName. How can i do this?
this.state.fullForm.MyFormNameObject.keys(this.state.fullForm). MyFormName.map