TypeError: 无法读取未定义的属性 ‘displayName’,js 引擎: hermes (React Native)

huangapple go评论57阅读模式
英文:

TypeError: Cannot read property 'displayName' of undefined, js engine: hermes (React Native)

问题

我正在尝试构建一个React Native移动应用程序,但它在完全构建后总是显示下面的错误。我正在使用TypeScript。我正在使用Expo Cli,还使用了React Native版本"react-native": "0.71.6"。如果我点击"dismiss",它将关闭错误并加载应用程序。请帮助!我不知道出了什么问题。这不是我的代码,因为在我开始编写之前,它就显示这个错误,就在我完成设置Eslint和Prettier之后。TypeError: 无法读取未定义的属性 ‘displayName’,js 引擎: hermes (React Native)

英文:

I am trying to build a React native mobile app, but it always presents the below error after which it has been completely built. I'm making use of TypeScript. I'm making use of Expo Cli and also I'm using react native version "react-native": "0.71.6". If I click on dismiss, it will dismiss the error and the app will load. Kindly help! I don't know what's wrong. It's not my code because before I started writing, it was showing this, just immediately I finished setting up Eslint and Prettier TypeError: 无法读取未定义的属性 ‘displayName’,js 引擎: hermes (React Native)

答案1

得分: 4

问题是我遇到了相同的情况。对我来说,问题在于我使用了具名导出(named export)导出我的应用程序。当将其更改为默认导出(default export)时,一切都按照应该的方式运行了。

英文:

I had the same issue. The problem for me was that I exported my App using named export. When changing it into a default export everything worked like it should.

huangapple
  • 本文由 发表于 2023年4月4日 16:06:55
  • 转载请务必保留本文链接:https://go.coder-hub.com/75926939.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定