Open
Description
It would be interesting if you exposed the value
prop to facilitate integration with the Controller
from 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"
/>