I want to Replace the Object Key name "Value" to "label" and Pass down to DropdownList.. For Example, I am Using "item.value" in the Dropdown Component, But now I need to get the Inputs Data and replace "item.value" to "item.label"... So How Can I change that Object Key name and render the List in DropDown Can Anyone help in this, Thanks in Advance
export const inputs = {
"purpose": [
{
"locale": "er",
"code": "zzz",
"value": "Payment"
},
{
"locale": "po",
"code": "dgf",
"value": "Support"
},
{
"locale": "fg",
"code": "oiuy",
"value": "yes Worked"
},
Here is the Dropdown
const Dropdown = () => {
const data = inputs;
//console.log(data.purpose);
return (
<select >
<option>Select an Option</option>
{data.purpose.map((items)=>(
//console.log(items.value);
<option>{items.value}</option>
))}
</select>
</div>
</div>
)
}
export default Dropdown