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

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

    Given your error of:

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

    You have 2 options:

    1. Your export file can have the word default as in export default class ____.... Then your import will need to avoid using {} around it. As in import ____ from ____

    2. Avoid using the default word. Then your export looks like export class ____... Then your import must use the {}. Like import {____} from ____

提交回复
热议问题