I am trying to implement RadioGroup in redux form.
Please see the below code. It throws the following error:
Uncaught TypeError: Cannot read property 'muiName' of undefined
at isMuiElement (reactHelpers.js:36)
at FormControl.js:154
const renderRadioGroup = ({ input, label, children, meta: { touched, error, inavlid }, ...custom }) => {
return (
<FormControl error={touched && invalid}>
<FormLabel component="legend"><FormattedMessage id={label} /></FormLabel>
<RadioButtonGroup
{...input}
{...custom}
valueSelected={input.value}
onChange={(event, value) => input.onChange(value)}
>
{children}
</RadioButtonGroup>
</FormControl>
)
};
export default renderRadioGroup;
Usage:
<Field
aria-label="gender"
name="gender2"
component={renderRadioGroup}
label="Approved"
value={this.state.value}
onChange={this.handleChange}
>
<FormControlLabel value="male" control={<Radio color="primary" />} label="Male" />
<FormControlLabel value="female" control={<Radio color="primary" />} label="Female" />
<FormControlLabel value="other" control={<Radio color="primary" />} label="Other" />
<FormControlLabel
value="disabled"
disabled
control={<Radio />}
label="(Disabled option)"
/>
</Field>
_
| Tech | Version |
|--------------|---------|
| Material-UI | 1.0.0-beta.25 |
| React | 16.2.0 |
| browser | Chrome 66 |
| etc | |
What was the resolution? I'm coming up with the same error?
Material-UI 1.2.0
React 16.4.0
I had the same error, this was due to an import that was incorrect (pre v1: in my case import { ExpansionPanelSummary } from '@material-ui/core/ExpansionPanel'; to import ExpansionPanelSummary from '@material-ui/core/ExpansionPanelSummary';)
Most helpful comment
What was the resolution? I'm coming up with the same error?
Material-UI 1.2.0
React 16.4.0