Relative Content

Tag Archive for reactjsmaterial-uireact-hook-form

Chosen false with mui radio btn gives required error with react hook form

I am using v7 react hook form and mui, my radio btn choices should been saved as boolean, default value can be null, false or true as boolean(except null). I choose false and click submit, throws required error although there is a choice with false option. My FormFieldBox and StyledRadioGroup components are just for styling.

MUI Autocomplete field clears after onSubmit

I’m working on a React application using react-hook-form and @mui/material, and I have a form that includes an Autocomplete component for selecting multiple values. The issue I’m facing is that when I submit the form, the value of the Autocomplete field resets to its initial state.