logo image

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.


Getting following error after migrating to material-ui 1.0

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.

1 Answer

2 years ago by

There was a problem with my imports. I was using the following

import { ListItem, ListItemIcon, ListItemText } from '@material-ui/core/List';

Which need to be updated to

import ListItem from '@material-ui/core/ListItem';
import ListItemIcon from '@material-ui/core/ListItemIcon';
import ListItemText from '@material-ui/core/ListItemText';
2 years ago by Megamind

We are looking for Interns!
Send your resumes to
[email protected]