jeudi 2 novembre 2017

Semantic React - Form.Select how to use custom array options

the semantic react docs about From.Select is to give it a prop options that needs to have a specific array like that :

const options = [
 { key: 'm', text: 'Male', value: 'male' },
 { key: 'f', text: 'Female', value: 'female' },
]

and using it like that :

<Form.Field control={Select} label='Gender' options={options} placeholder='Gender' />

if i want to use other array with custom keys and values like that for example :

const options = [
 { date: 'somedate', title: 'sometitle', },
 { date: 'somedate', title: 'sometitle', },
]

i am getting an error about using wrong props

my question is how can i use my own array with this Select Component thanks !




Aucun commentaire:

Enregistrer un commentaire