Material-ui: <FormControl> with redux-form throws 'Cannot read property 'muiName' of undefined'

Created on 27 Apr 2018  路  2Comments  路  Source: mui-org/material-ui

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>

_

  • [ ] I have searched the issues of this repository and believe that this is not a duplicate.

Context

Your Environment

| Tech | Version |
|--------------|---------|
| Material-UI | 1.0.0-beta.25 |
| React | 16.2.0 |
| browser | Chrome 66 |
| etc | |

question

Most helpful comment

What was the resolution? I'm coming up with the same error?

Material-UI 1.2.0
React 16.4.0

All 2 comments

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';)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

newoga picture newoga  路  3Comments

rbozan picture rbozan  路  3Comments

anthony-dandrea picture anthony-dandrea  路  3Comments

pola88 picture pola88  路  3Comments

mb-copart picture mb-copart  路  3Comments