Open TonySilva7 opened 5 months ago
It would be interesting if you exposed the value prop to facilitate integration with the Controller from react-hook-form.
value
Controller
react-hook-form
Instead of using it like this...
<Controller control={control} render={({field: {onChange, value}}) => ( <SelectList setSelected={onChange} data={options} save="value" fontFamily={fonts.family.jostRegular} defaultOption={{ key: value, value: options.find(o => o.value === value)?.label ?? value, }} /> )} name="fruits" />
We would use it like this...
<Controller control={control} render={({field: {onChange, value}}) => ( <SelectList setSelected={onChange} data={options} save="value" fontFamily={fonts.family.jostRegular} value={value} // here <<----- /> )} name="fruits" />
It would be interesting if you exposed the
value
prop to facilitate integration with theController
fromreact-hook-form
.Instead of using it like this...
We would use it like this...