跳到主要内容

React Native

学习一次,随处编写。

使用 React 为 Android、iOS 等创建原生应用

React Native 将使用 React 进行开发的最优部分带到了原生开发中。
它是用于构建用户界面的业界一流的 JavaScript 库。

index.js
function HomeScreen() { 
return (
<View>
<Text> Hello World 👋 🌍!</Text>
</View>
);
}
Android device and iOS deviceAndroid device and iOS device

用 JavaScript 编写,用原生代码渲染。 React 原语渲染到原生平台 UI,这意味着您的应用使用与其他应用相同的原生平台 API。

为所有人进行原生开发

React Native 让您能够创建真正的原生应用,并且不会损害用户的体验。它提供了一组核心的平台无关原生组件,如 View TextImage,它们直接映射到平台的原生 UI 构建块。

A React Native UI pointing out native elements like Views, ScrollViews, and moreA React Native UI pointing out native elements like Views, ScrollViews, and more

使用框架抢占先机

React Native 将 React 编程范式带到了 Android 和 iOS 等平台。它不规定如何进行路由,或如何访问众多平台 API 中的每一个。要使用 React Native 构建一个新应用,我们推荐使用一个框架,例如 Expo.

File system with folders and files representing screens and navigationFile system with folders and files representing screens and navigation

基于文件的路由

使用您的文件系统创建堆栈、模态、抽屉和选项卡屏幕,只需最少的样板代码。

Grid of icons representing libraries, SDKs, and native codeGrid of icons representing libraries, SDKs, and native code

使用任何库、SDK 或原生代码

生成原生更改或编写您自己的原生代码。使用 50 多个模块来创建您的应用。

List of developer tool toggles for debugging, performance, and moreList of developer tool toggles for debugging, performance, and more

开发者工具

通过 Expo Go 快速上手,然后继续使用 expo-dev-client:一个为需要原生更改的应用添加 Expo 工具的模块。

观看并学习

观看 React 团队的演讲,学习如何充分利用 React Native。
在以下平台找到最新消息 Bluesky X.

FB 2019:使用 React Native 进行移动创新

45:29

为什么选择 React Native?

1:42

由 Meta 支持。由社区驱动。

Meta 于 2015 年发布了 React Native,并一直维护至今。

2018 年,React Native 在 GitHub 上拥有 第二高 的贡献者数量,领先于其他任何仓库。今天,React Native 得到了来自全球个人和公司的贡献支持,其中包括 Callstack, ExpoInfinite Red Microsoft Software Mansion.

我们的社区总是在推出令人兴奋的新项目,并探索 Android 和 iOS 之外的平台,例如以下仓库: React Native Windows, React Native macOS React Native Web.

React Native 已被数千个应用使用,但您很可能已经在以下应用中使用过它

  • Facebook
  • Facebook Ads Manager
  • Meta Horizon
  • Messenger Desktop
  • Microsoft Office
  • Microsoft Outlook
  • Microsoft Teams
  • Xbox Game Pass
  • Amazon Shopping
  • Shopify
  • Shop: All your favorite brands
  • Coinbase
  • PUMA
  • PlayStation App
  • WordPress - Website Builder
  • Tableau
  • FlipKart
  • Mercari
  • Discord
  • Bloomberg
  • Tesla
  • Bolt Food: Delivery & Takeaway
  • Mattermost
  • Klarna | Shop now. Pay later.
  • NFL

以及更多

欢迎加入 React Native 社区

开始使用