A framework for building native macOS apps with React.
Перейти к файлу
acdlite c2be0ad40e Rethrow errors from form actions (#26689)
Summary:
This is the next step toward full support for async form actions.

Errors thrown inside form actions should cause the form to re-render and
throw the error so it can be captured by an error boundary. The behavior
is the same if the `<form />` had an internal useTransition hook, which
is pretty much exactly how we implement it, too.

The first time an action is called, the form's HostComponent is
"upgraded" to become stateful, by lazily mounting a list of hooks. The
rest of the implementation for function components can be shared.

Because the error handling behavior added in this commit is just using
useTransition under-the-hood, it also handles pending states, too.
However, this pending state can't be observed until we add a new hook
for that purpose. I'll add this next.

DiffTrain build for commit fd3fb8e3c5.

Changelog: [Internal]

Reviewed By: poteto

Differential Revision: D45238266

Pulled By: kassens

fbshipit-source-id: 93fe8581172522f955278918bf97a0eb54daeeed
2023-04-25 09:58:50 -07:00
.bundle Introduce Gemfile, ruby-version (#32303) 2021-10-01 21:22:26 -07:00
.circleci Remove instructions from `Dockerfile.android` that are BUCK related. (#36958) 2023-04-18 11:54:36 -07:00
.github Remove stale CODEOWNERS (#36199) 2023-04-25 09:36:21 -07:00
IntegrationTests Re-sync repo after ShipIt change - Removal of BUCK files (#36955) 2023-04-19 12:12:04 +01:00
docs Generate doc info for RN components 2019-09-19 18:36:25 -07:00
gradle Gradle to 8.1 (#37018) 2023-04-21 04:52:54 -07:00
jest Internal Jest setup - improve workaround for Babel registration (#36838) 2023-04-11 10:08:53 -07:00
packages Rethrow errors from form actions (#26689) 2023-04-25 09:58:50 -07:00
scripts Remove Buck OSS 1 setup. (#36900) 2023-04-13 13:19:24 -07:00
tools Remove Buck OSS 1 setup. (#36900) 2023-04-13 13:19:24 -07:00
.babelrc react-native code-gen > C++ TurboModules enum example (#36083) 2023-02-08 20:24:28 -08:00
.buckconfig Add support for Buck oncall annotations (#35562) 2022-12-05 06:12:46 -08:00
.buckjavaargs limiting BUCK's memory for CI 2016-02-01 10:49:33 -08:00
.clang-format Moving ObjC specific clang-format rules to the common config 2019-02-11 13:07:09 -08:00
.editorconfig Revert removal of CRLF from Windows bat files (#31398) 2021-09-09 22:44:32 -07:00
.eslintignore | RN Monorepo | Migrate to package (#36434) 2023-03-17 05:03:25 -07:00
.eslintrc.js | RN Monorepo | Migrate to package (#36434) 2023-03-17 05:03:25 -07:00
.flowconfig Upgrade to Flow v0.204.0 (#36928) 2023-04-17 11:18:28 -07:00
.flowconfig.android Upgrade to Flow v0.204.0 (#36928) 2023-04-17 11:18:28 -07:00
.gitignore Add `@react-native/codegen-typescript-test` to verify .d.ts files in `@react-native/codegen` (1) (#36562) 2023-04-05 07:38:25 -07:00
.prettierrc chore: specify `eol` config in `.prettierrc` as `lf` (#36884) 2023-04-17 12:38:24 -07:00
CHANGELOG.md Update CHANGELOG with 0.71.7 release (#36973) 2023-04-20 01:54:41 -07:00
CODE_OF_CONDUCT.md docs: add new version convenant contribuitor guide link (#32107) 2021-08-30 10:18:11 -07:00
CONTRIBUTING.md Update CONTRIBUTING.md, replace wiki links (#34035) 2022-06-21 19:30:23 -07:00
ECOSYSTEM.md Updates to ecosystem.md do clarify community roles (#34341) 2022-09-26 14:27:11 -07:00
Gemfile Bump activesupport to 6.1.7.3 to address CVE-2023-28120 (#36803) 2023-04-04 12:49:17 -07:00
Gemfile.lock Bump activesupport to 6.1.7.3 to address CVE-2023-28120 (#36803) 2023-04-04 12:49:17 -07:00
LICENSE-docs More licenses 2015-03-24 19:59:10 -07:00
README.md chore: update all website links about react (#36638) 2023-04-14 06:23:52 -07:00
build.gradle.kts Rename cleanAll to clean and refine it (#36832) 2023-04-06 05:54:15 -07:00
gradle.properties Do not specify a Kotlin version in the RN rootProject (#33589) 2022-04-08 03:44:56 -07:00
gradlew Gradle to 8.1 (#37018) 2023-04-21 04:52:54 -07:00
gradlew.bat Bump Gradle to 8.x (#36269) 2023-02-27 13:47:09 -08:00
jest.config.js Use FB-specific renderers when running tests in Meta infra (#36877) 2023-04-12 05:17:01 -07:00
package.json Bump CLI to 12.0.0-alpha.3 and Metro to 0.76.2 (#36948) 2023-04-18 13:21:23 -07:00
runXcodeTests.sh Use realpath instead of readlink 2022-02-22 02:23:02 -08:00
settings.gradle.kts | RN Monorepo | Migrate to package (#36434) 2023-03-17 05:03:25 -07:00
yarn.lock RN: Upgrade to deprecated-react-native-prop-types@4.1.0 2023-04-20 13:19:41 -07:00

README.md

React Native

Learn once, write anywhere:
Build mobile apps with React.

React Native is released under the MIT license. Current CircleCI build status. Current npm package version. PRs welcome! Follow @reactnative

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

React Native brings React's declarative UI framework to iOS and Android. With React Native, you use native UI controls and have full access to the native platform.

  • Declarative. React makes it painless to create interactive UIs. Declarative views make your code more predictable and easier to debug.
  • Component-Based. Build encapsulated components that manage their state, then compose them to make complex UIs.
  • Developer Velocity. See local changes in seconds. Changes to JavaScript code can be live reloaded without rebuilding the native app.
  • Portability. Reuse code across iOS, Android, and other platforms.

React Native is developed and supported by many companies and individual core contributors. Find out more in our ecosystem overview.

Contents

📋 Requirements

React Native apps may target iOS 12.4 and Android 5.0 (API 21) or newer. You may use Windows, macOS, or Linux as your development operating system, though building and running iOS apps is limited to macOS. Tools like Expo can be used to work around this.

🎉 Building your first React Native app

Follow the Getting Started guide. The recommended way to install React Native depends on your project. Here you can find short guides for the most common scenarios:

📖 Documentation

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

The React Native documentation discusses components, APIs, and topics that are specific to React Native. For further documentation on the React API that is shared between React Native and React DOM, refer to the React documentation.

The source for the React Native documentation and website is hosted on a separate repo, @facebook/react-native-website.

🚀 Upgrading

Upgrading to new versions of React Native may give you access to more APIs, views, developer tools, and other goodies. See the Upgrading Guide for instructions.

React Native releases are discussed in this discussion repo.

👏 How to Contribute

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

Facebook 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.

Open Source Roadmap

You can learn more about our vision for React Native in the Roadmap.

Good First Issues

We have a list of good first issues that contain bugs which have a relatively limited scope. This is a great place to get started, gain experience, and get familiar with our contribution process.

Discussions

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

📄 License

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

React Native documentation is Creative Commons licensed, as found in the LICENSE-docs file.