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

前端 未结 30 1456
孤城傲影
孤城傲影 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:43

    In my case (using Webpack) it was the difference between:

    import {MyComponent} from '../components/xyz.js';
    

    vs

    import MyComponent from '../components/xyz.js';
    

    The second one works while the first is causing the error. Or the opposite.

提交回复
热议问题