react-native README

The project's README from github.com/react/react-native. As one markdown file: README.md.

React Native logo

Learn once, write anywhere:
Create native apps for Android, iOS, and more using React

React Native is released under the MIT license Current npm package version Monthly npm downloads Follow @reactnative on X

Getting Started · Learn the Basics · Showcase · Contribute · Community · Support

React Native

React Native lets you build native apps using React. Written in JavaScript, rendered with native code.

React Native is developed and supported by many companies and individual core contributors. Find out more on the React Foundation website.

Building your first React Native app

Follow the Getting Started guide for a new app, or Integration with Existing Apps to adopt React Native incrementally.

Using a Framework

We believe that the best way to experience React Native is through a Framework, a toolbox with all the necessary APIs to let you build production ready apps. Expo is a production-grade React Native Framework, with file-based routing, a standard library of native modules, and much more.

To create a new Expo project, run the following in your terminal:

npx create-expo-app@latest

Then follow the rest of Expo's getting started guide to start building.

Without a Framework

You can also use React Native without a Framework, however we've found that most developers benefit from one — navigation, native dependencies, and platform tooling are problems the ecosystem has already solved. If a Framework doesn't suit your app, follow Getting Started Without a Framework.

Documentation

The full documentation for React Native can be found on our website.

The source for the React Native docs and website is hosted on a separate repository, react/react-native-website.

Contributing

The main purpose of this repository is to continue evolving React Native core. We want to make contributing to this project as easy and transparent as possible, and we are grateful to the community for contributing bug fixes and improvements. Read below to learn how you can take part in improving React Native.

Code of Conduct

Meta has adopted a Code of Conduct that we expect project participants to adhere to. Please read the full text so that you can understand what actions will and will not be tolerated.

Contributing Guide

Read our Contributing Guide to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to React Native.

Discussions

Larger discussions and proposals are discussed in react-native-community/discussions-and-proposals.

React Native releases are discussed in reactwg/react-native-releases.

License

React Native is MIT licensed, as found in the LICENSE file.

react-native (react/react-native)

Searching Database…

这是什么?React Native 让你可以用 React 构建 Android、iOS 等平台的原生移动应用。界面用 JavaScript 描述,但渲染时使用真正的原生平台组件,而不是网页视图(webview)。
这是一个 UI 库,还是像完整应用框架那样的东西?它是一个核心框架:提供原生 UI 基础组件、JS 与原生代码之间的桥接(Native Modules),以及渲染架构。但它本身并不是一套完整的工具集——项目建议搭配 Expo 这样的更高层框架使用,由后者负责路由、原生依赖管理和开发工具等。
怎样创建一个新的 React Native 应用?推荐的方式是使用 Expo:运行 'npx create-expo-app@latest',然后按照 Expo 的入门指南操作。你也可以不使用框架,改为参考 'Getting Started Without a Framework' 指南,或者把 React Native 集成到现有的原生应用中。
还需要安装原生移动开发工具吗?需要。React Native 渲染的是真正的原生界面,并且自带用于调用平台代码的 Native Modules,因此除了 Node/JavaScript 工具外,你还需要安装标准的 Android/iOS 开发工具链(Android Studio/Gradle、Xcode/CocoaPods)。
直接不用任何框架来使用它会更好吗?项目维护者明确不建议大多数人这样做:导航、原生依赖和平台工具链在 Expo 生态中已被视为解决了的问题,如果不用框架,就得自己解决这些问题。
它支持哪些平台?主要支持 Android 和 iOS,其宣传口号是“一次学习,随处编写”,承诺通过它可以构建“Android、iOS 等平台的原生应用”。
开发时修改 JavaScript 代码会发生什么?Fast Refresh 能在几秒内应用 JS 代码的修改,无需重新构建原生应用,因此你几乎可以立即看到本地修改的效果。
界面真的使用原生组件吗?还是网页视图?它渲染的是真正的原生平台 UI 基础组件,因此手势、文字缩放和无障碍功能在每个操作系统上的表现都与用户预期一致,而不是通过嵌入的浏览器实现。
我可以把 React Native 添加到已有的应用中吗?可以,“Integration with Existing Apps”指南介绍了如何在现有原生代码库中逐步引入 React Native。
如果需要 React Native 没有自带的功能怎么办?你可以编写 Native Modules,从 JavaScript 直接调用平台代码(同步且类型安全),也可以使用数以千计的现有社区库。
Creator
react
Size
965.5 MB
Stars
126.7K
Age
11y
Commits · 90 Days