I couldn't really find this anywhere else so here we go. I'm trying to map through a nested object and display the values but all I can get is the key displayed.
Object:
data = {
objectOne: {
name: "some name",
otherValue: "something else"
},
someValue: "someValue",
someOtherValue: "asdasd",
objectTwo : {
v1 : "v1",
v2 : "v2",
v3 : "v3",
}
}
My function to loop through it: (I only want to display the content of objectOne)
Object.keys(data.objectOne).map(field => <div key={field}>{field}</div>
This returns name and otherValue but not the actual values.
What am I missing here?