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

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

    In my case, one of the exported child module was not returning a proper react component.

    const Component = 
    Content
    ;

    instead of

    const Component = () => 
    Content
    ;

    The error shown was for the parent, hence couldn't figure out.

提交回复
热议问题