React Native 0.64 发布,iOS 上 Hermes 支持

栏目: 软件资讯 · 发布时间: 4年前

内容简介:React Native 0.64 已经发布了,此版本主要亮点包括: 在 iOS 上加入 Hermes 默认情况下启用 Inline Requires React 17 Hermes opt-in on iOS 在此版本中,用户可以使用 Hermes 在 iOS 上进行构建。要在 iOS 上启...

React Native 0.64 已经发布了,此版本主要亮点包括:

  • 在 iOS 上加入 Hermes
  • 默认情况下启用 Inline Requires
  • React 17

Hermes opt-in on iOS

在此版本中,用户可以使用 Hermes 在 iOS 上进行构建。要在 iOS 上启用 Hermes,可在你的 Podfile 中设置 hermes_enabled 为 true,然后运行 pod 安装。

use_react_native!(
   :path => config[:reactNativePath],
   # to enable hermes on iOS, change `false` to `true` and then install pods
   :hermes_enabled => true
)

 所有必要的更改将自动完成。值得注意的是,iOS 上对 Hermes 的支持仍处于早期阶段。

默认情况下启用 Inline Requires

Inline Requires 是一个 Metro 配置选项,其已作为一种可选配置选项存在多年。现在,新的应用程序将默认启用 Inline Requires 选项,以帮助人们无需额外配置即可快速使用 React Native 应用程序。

Inline Requires 是一种 Babel 变换,它可以将模块导入并转换为 inline。例如,Inline Requires 将这个模块导入调用从文件的 top 转换到使用它的地方。

Before:

import { MyFunction } from 'my-module';

const MyComponent = (props) => {
  const result = myFunction();

  return (<Text>{result}</Text>);
};

After:

const MyComponent = (props) => {
  const result = require('my-module').MyFunction;

  return (<Text>{result}</Text>);
};

更多相关信息可查看文档

React 17

React 17 不包含面向开发者的新功能,也没有重大的突破性变化。对于 React Native 应用来说,主要的变化是一个新的 JSX 转换,使得文件不再需要导入 React 就能够使用 JSX。

有关 React 17 的更多信息,可参见 React 博客

完整更新内容可以查看:


以上所述就是小编给大家介绍的《React Native 0.64 发布,iOS 上 Hermes 支持》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Letting Go of the Words

Letting Go of the Words

Janice (Ginny) Redish / Morgan Kaufmann / 2007-06-11 / USD 49.95

"Redish has done her homework and created a thorough overview of the issues in writing for the Web. Ironically, I must recommend that you read her every word so that you can find out why your customer......一起来看看 《Letting Go of the Words》 这本书的介绍吧!

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具