redux-form-material-ui icon indicating copy to clipboard operation
redux-form-material-ui copied to clipboard

FormControlLabel produces error 'Element type is invalid:'

Open aikidoshi opened this issue 7 years ago • 1 comments

When used as per the website example thusly:

import {
    Checkbox,
    RadioGroup,
    Select,
    TextField,
    Switch,
    FormControlLabel
} from 'redux-form-material-ui'


<FormControlLabel control={<Field name="Solo" component={Checkbox} /> } label="Solo?" />

I get the following error:

Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

aikidoshi avatar Jun 14 '18 22:06 aikidoshi

FormControlLabel must be imported from Material Ui like so:

import FormControlLabel from '@material-ui/core/FormControlLabel';

Example needs to be updated.

Neo478 avatar Jun 26 '18 11:06 Neo478