Element type is invalid: expected a string (for built-in components) or a class/function (for com...

今天在用react写后台出现了一个错误,找了好久才找到

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.

问题截图

有说是因为没有使用 export default 进行导出,但是我的代码里面都是这样写的,最后发现是我的父级路由没有绑定component导致的

问题代码

最后将代码修改成绑定组件即可

正确代码
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。