javascript - React Native iOS - 在 Podfile 中启用 Hermes,但在应用程序中未启用
问题描述
我正在尝试在我的适用于 iOS 的 React Native 0.65 应用程序中启用 Hermes。我已按照文档通过对我的 Podfile 进行此更改来启用 Hermes:
use_react_native!(
:path => config[:reactNativePath],
# to enable hermes on iOS, change `false` to `true` and then install pods
- :hermes_enabled => false
+ :hermes_enabled => true
)
然后我清理了构建文件夹,运行pod install
并在调试模式下为物理 iOS 设备重建了我的应用程序。但是,在我的应用程序中运行 React Native 提供的以下代码表明 Hermes 实际上已禁用:
const isHermes = () => !!global.HermesInternal; // <-- returns false
如何在我的应用程序中启用 Hermes?我正在运行 React Native 0.65.1,最近从 0.64.2 升级。谢谢你。
解决方案
你核对了undefined
值。put!!
将评估为布尔值。
推荐阅读
- javascript - 如何处理数组内对象的 onChange(反应状态)?
- android - 如何从 firebase 只获取一次数据并且不监听任何数据更改
- r - 对列中的值进行计数以创建汇总表的最佳方法是什么?
- django - 如何在 django 中捕获和存储图像
- javascript - 如何禁用来自循环的其他div,除了单击的div
- javascript - blob url 在撤销时不播放。如何防止下载视频
- javascript - html提交按钮链接到下一页
- python - 递归未进入基本情况
- node.js - aws s3 节点 js sdk 方法 generatePutUrl 返回 localhost 和 heroku 上部署的不同结果
- openshift - 我可以从模板中的参数设置 env 键吗