React convert props Objects into array then setState

Viewed 21835

I need to convert this props:

enter image description here

into this array:

this.setState({
            locations: [
                { label: 'California', value: 'california' },
                { label: 'Nevada', value: 'nevada' },
            ]
});

originally i was using this plugin and wanted to replace its default values with my props but cant convert it.

1 Answers
Related