shoutem/ui

How to create DropDownMenu from array of names

vikramkh opened this issue · 0 comments

I tried to create the following, but it was null. The docs doesn't explain valueProperty well. Is it necessary/what would it be in this case

in state I have:
data = ['cars', 'buses']
activeCategory = 'cars'

const category = this.state.activeCategory

return (
<DropDownMenu
styleName="horizontal"
options={this.state.data}
selectedOption={data}
onOptionSelected={(category) => this.setState({ activeCategory: category })}
// ?? titleProperty="brand"
// ?? valueProperty="cars.model"
/>