react-native-gifted-form
react-native-gifted-form copied to clipboard
modalwidget with selectwidget
I'm trying to work on modalwidget with selectwidget. My code look like below
<GiftedForm.ModalWidget
title='Wallet'
displayValue='wallet'
>
<GiftedForm.SeparatorWidget />
<GiftedForm.SelectWidget name='wallet' title='Wallet' multiple={false}>
{
this.state.WalletList.map((u, i) => {
return (
<GiftedForm.OptionWidget
key={u.wallet_code}
title={u.wallet_code} value={u.wallet_code}/>
);
})
}
As you can see that I try to map my optionwidget when the state change. It work flawlessly without modal but with the modalwidget, it load my original value.
Hope somebody can help me out here.
Why are you returning a from a function after map? Should be...
...
this.state.WalletList.map((u, i) => (
<GiftedForm.OptionWidget key={u.wallet_code} title={u.wallet_code} value={u.wallet_code}/>
));
...