Uncaught Error: Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function but got: object

前端 未结 30 1417
孤城傲影
孤城傲影 2020-11-22 06:53

I am getting this error:

Uncaught Error: Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/funct

30条回答
  •  轮回少年
    2020-11-22 07:40

    @Balasubramani M saved me here. Wanted to add one more to help people. This is the problem when you're gluing too many things together and being cavalier with versions. I updated a version of material-ui and need to change

    import Card, {CardContent, CardMedia, CardActions } from "@material-ui/core/Card"; 
    

    to this:

    import Card from '@material-ui/core/Card';
    import CardActions from '@material-ui/core/CardActions';
    import CardContent from '@material-ui/core/CardContent';
    import CardMedia from '@material-ui/core/CardMedia';
    

提交回复
热议问题