当前位置 : 主页 > 网页制作 > React >

React错误收集

来源:互联网 收集:自由互联 发布时间:2021-06-15
1. Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it‘s defined in, or you mi

1.  Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it‘s defined in, or you might have mixed up default and named imports

这个错误,最常见的问题是import组件出错。例如,

import { com } from ‘t-com‘  
//写成了  
import com from ‘t-com‘

或者

import com from ‘t-com‘  
//写成了  
import { com } from ‘t-com‘
网友评论