Using this data set to listData state in React:
[
{
"Key": "Anchorage TAC 82.tif",
"LastModified": "2019-04-07T03:25:51.000Z",
"ETag": "\"9f904f2219d1edf3fa39b171c98de924-6\"",
"Size": 28135199,
"StorageClass": "STANDARD"
},
{
"Key": "CSA-L01.pdf",
"LastModified": "2019-04-07T03:25:36.000Z",
"ETag": "\"90f166238ae6b1f64120e984be743ba4\"",
"Size": 3406742,
"StorageClass": "STANDARD"
}
]
How can I map the Key values into a drop downlist. I've tried:
<select>
<option>Please select a file:</option>
{Object.keys(this.state.listData).map(val =>
<option value={val.Key}>{val.Key}</option>) }
</select>
and it's not working. I'm getting a blank drop down list.