Below is the response coming back. I'm trying to map through the logo object so that I can grab the url, however my implementation on Object.keys is not working. What am I doing wrong?
[
{
"title": "Header",
"logo": {
"metadata": {},
"sys": {},
"fields": {
"title": "Logo",
"file": {
"url": "xxxxxx",
"details": {},
"fileName": "logo.png",
"contentType": "image/png"
}
}
},
"links": []
}
]
{Object.keys(header.logo.fields.file).map((logo) => (
<p>{logo.url}</p>
))}
headeris the thing you show us above your code, that's an array not an object, so you needheader[0].logo.fields.fileetc.urlproperty (they are just strings).