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

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

    I got this error in react routing, problem was that I was using

    } exact />

    but it was wrong route requires component as a class/function so I changed it to

    and it worked. (Just avoid the braces around the component)

提交回复
热议问题