dohomi / react-hook-form-mui

Material-UI form components ready to use with react-hook-form
https://react-hook-form-material-ui.vercel.app
MIT License
561 stars 111 forks source link

SelectElement with default preselected option #287

Closed FDiskas closed 4 months ago

FDiskas commented 4 months ago

Duplicates

Latest version

Current behavior 😯

I was unable to preselect the default option by providing defaultValue option to a SelectElement If I do render simple MUI component it works

Expected behavior 🤔

I should be able to use defaultValue

Steps to reproduce 🕹

Example: https://react-f3w5pk.stackblitz.io

dohomi commented 4 months ago

https://github.com/dohomi/react-hook-form-mui/blob/master/apps/storybook/stories/TextFieldElement.stories.tsx#L27 you provide defaultValues to React Hook Form once for all fields.