📜  × 错误:元素类型无效:应为字符串(对于内置组件)或类函数(对于复合组件),但得到:未定义.您可能忘记从文件中导出组件 - 无论代码示例

📅  最后修改于: 2022-03-11 14:58:42.882000             🧑  作者: Mango

代码示例1
In my case (using Webpack) it was the difference between:

import {MyComponent} from '../components/xyz.js';
vs

import MyComponent from '../components/xyz.js';
The second one works while the first is causing the error. Or the opposite.