Replies: 3 comments
-
due to your schema:
|
Beta Was this translation helpful? Give feedback.
-
1 year later but, please see my workaround solution (example with MUI but it would help anyway if using React Hook Form): |
Beta Was this translation helpful? Give feedback.
-
try this import PropTypes from 'prop-types'; import Radio from '@mui/material/Radio'; // ---------------------------------------------------------------------- export default function RHFRadioGroup({ return (
); RHFRadioGroup.propTypes = { |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am building a form with RHF V7, MUI V5 and validating its data with yup. The issue I am facing is that a radio button group is returning a string of 'true' or 'false' despite providing it with a boolean
true
orfalse
value.Additionally, I test the radio value via
onChange={() => console.log(typeof item.value)}
and it logsBoolean
every time yet, when I log the form data I get{Radio: "true"}
.here is the working example: https://codesandbox.io/s/rhf-v7-radio-casting-string-wiou8
Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions