当我尝试运行 yarn ios
时,我得到:
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.
Check the render method of `MyApp`.
但是我的 App.tsx
有:
class MyApp extends App {
render() {
const { Component, pageProps } = this.props;
return (
<ThemeProvider theme={theme}>
<ScrollView>
<Component {...pageProps} />
</ScrollView>
<FooterBar />
</ThemeProvider>
)
}
}
export default MyApp
所以我不确定它在提示什么?
最佳答案
尝试直接从其来源导入组件,然后插入 pageProp。所以在例子中:
import {Component} from '../pathOfComponent';
关于node.js - next.js + expo : You likely forgot to export your component from the file it's defined in, 或者您可能混淆了默认导入和命名导入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61492785/