Redux-form-material-ui: FormControlLabel produces error 'Element type is invalid:'

Created on 15 Jun 2018  路  1Comment  路  Source: erikras/redux-form-material-ui

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.

Most helpful comment

FormControlLabel must be imported from Material Ui like so:

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

Example needs to be updated.

>All comments

FormControlLabel must be imported from Material Ui like so:

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

Example needs to be updated.

Was this page helpful?
0 / 5 - 0 ratings