I have seen a similar question here (how to display json data in dropdown using reactj), but it does not answer my query.
I have some JSON data coming in from an ajax request in my react app:
"quotes":{
"USDAED":3.6732,
"USDAFN":77.588904,
"USDALL":103.298421,
"USDAMD":528.084946,
"USDANG":1.795181,
"USDAOA":628.150147,
"USDARS":92.5812
}
Its a list of currencies and their conversion rates.
I need to render a select dropdown list out of it in a react component such that the json data is transformed into keys and values:
<select className="dropdown">
<option key="USDAED" value="3.6732">USDAED</option>
<option key="USDAFN" value="77.588904">USDAFN</option>
...
Is there an easy way to traverse the json data and create a select dropdown in JSX?