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

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

    For me it was that my styled-components were defined after my functional component definition. It was only happening in staging and not locally for me. Once I moved my styled-components above my component definition the error went away.

提交回复
热议问题