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

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

    In my case, that was caused by wrong comment symbols. This is wrong:

    
        /*{ oldComponent }*/
        { newComponent }
    
    

    This is correct:

    
        {/*{ oldComponent }*/}
        { newComponent }
    
    

    Notice the curly brackets

提交回复
热议问题