Open gauravverma029 opened 6 years ago
I think what you want is:
this.state = {
optionValue :[
{value:'3',title:'A'},
{value:'4',title:'B'},
]
}
<GiftedForm.SelectWidget
name='staff'
multiple={true}
>
{this.state.optionValue.map(obj => (
<GiftedForm.OptionWidget
key={[your random key method]}
title={obj.title}
value={obj.value}
/>
))}
</GiftedForm.SelectWidget>
How to pass dynamic Data in option values in selectwidget
you cannot pass dynamic data to selectWidget, it only support hardcode data. you should use the other package before you have to regret like me!
Please Check this Link
https://stackoverflow.com/questions/49082122/react-native-gifted-form-how-to-pass-dynamic-option-values-in-selectwidget