FaridSafi / react-native-gifted-form

📝 « One React-Native form component to rule them all »
MIT License
1.44k stars 214 forks source link

How to pass dynamic Data in option values in selectwidget #126

Open gauravverma029 opened 6 years ago

gauravverma029 commented 6 years ago

Please Check this Link

https://stackoverflow.com/questions/49082122/react-native-gifted-form-how-to-pass-dynamic-option-values-in-selectwidget

sambwest commented 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>
ashishmv7 commented 5 years ago

How to pass dynamic Data in option values in selectwidget

kimngoc0347 commented 4 years ago

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!