AGENTS.md in react/react-native runs 669 words across 8 headings.
A framework for building native applications using React
Covers
6 of the 20 section tags
In the order a file is read inHeadings
8 headings, in the order the file writes them
01React Native
02Repo structure
03Environment
04Common commands
05Verification: Running RNTester
06Gotchas
07Generated code
08Contributing guidelines
Commands
16 commands this file writes down
Extracted from the file, verbatimyarn test <path>
yarn fantom <path>
yarn lint
yarn flow-check
yarn format
yarn format-check
yarn start
yarn android
yarn install
yarn.lock
yarn --cwd packages/react-native-codegen build
yarn build
yarn featureflags
yarn build-types
yarn test-generated-typescript
yarn cxx-api-build
The file
AGENTS.md
69 lines1# React Native
2
3A framework for building native applications using React.
4
5## Repo structure
6
7React Native is a monorepo: the `react-native` package, the packages published alongside it, and the apps and tooling used to develop them.
8
9| Path | Contents |
10| --- | --- |
11| `packages/react-native/Libraries` | JavaScript source (Flow) — the legacy location, with code gradually moving to `src/private` |
12| `packages/react-native/src/private` | JavaScript source (Flow) |
13| `packages/react-native/ReactCommon` | Shared C++ — Fabric renderer, TurboModules, JSI, Yoga, `jsinspector-modern` |
14| `packages/react-native/ReactAndroid` | Android runtime (Kotlin, Java, JNI) |
15| `packages/react-native/{React,ReactApple}` | Apple runtime (Objective-C++, Swift) |
16| `packages/rn-tester` | RNTester — test app showcasing each core component and API, plus a `Playground` scratch surface |
17| `packages/*` | Other published packages — Metro config, Codegen, ESLint config, dev-middleware, React Native DevTools frontend |
18| `private/*` | Unpublished — the `helloworld` sample app, the `react-native-fantom` test runner |
19| `scripts/*` | Repository tooling — build, test, release, and CI scripts |
20
21Architecture notes live in `__docs__` directories beside the code they describe, indexed by [`__docs__/README.md`](__docs__/README.md). Treat them as reference for the subsystem you are working in, not as required reading.
22
23## Environment
24
25- Yarn v1, pinned via `packageManager`. Run commands from the repository root.
26- JavaScript work — lint, type checks, Jest, Metro — needs only Node and Yarn, on any platform.
27- Native builds need a platform toolchain: Xcode with CocoaPods or Swift Package Manager for iOS (macOS only), and the Android SDK and NDK with Gradle for Android. See [Building from source](https://reactnative.dev/contributing/how-to-build-from-source).
28
29## Common commands
30
31| Command | Purpose |
32| --- | --- |
33| `yarn test <path>` | Jest unit tests, found in `__tests__` directories |
34| `yarn fantom <path>` | [Fantom](private/react-native-fantom/__docs__/README.md) integration tests, named `*-itest.js` — builds a native tester on first run |
35| `yarn lint` | ESLint (`--max-warnings 0`) |
36| `yarn flow-check` | Flow |
37| `yarn format` | Prettier and clang-format (`yarn format-check` for Prettier only) |
38
39JavaScript CI is the `lint`, `test_js`, and `build_js_types` jobs in [`.github/workflows/test-all.yml`](.github/workflows/test-all.yml); Fantom and the native platforms have their own jobs.
40
41### Verification: Running RNTester
42
43Needed only for changes that have to be seen running, such as user interface behavior.
44
45`yarn start` serves [RNTester](packages/rn-tester/README.md) over Metro at `http://localhost:8081`; `yarn android` builds and installs it on Android. Check the bundler with `curl "http://localhost:8081/js/RNTesterApp.bundle?platform=ios&dev=true"`.
46
47## Gotchas
48
49- `yarn install` dirties the working tree: a `preinstall` hook (`scripts/try-set-hermes-compiler-prebuilt.js`) resolves the `hermes-compiler` placeholder in `packages/react-native/package.json` (`0.0.0` → a real version) and touches `yarn.lock`. Expected — do not commit it.
50- Metro cannot bundle until codegen is built once — `yarn --cwd packages/react-native-codegen build`. Without it, bundling fails with `Cannot find module '@react-native/codegen/lib/parsers/flow/parser'`. Every other package runs from source — `yarn build` is not needed for development (see [`scripts/build/README.md`](scripts/build/README.md)).
51
52## Generated code
53
54Never hand-edit generated output — change the source and regenerate. CI validates the committed snapshots.
55
56- Native modules and components are declared by JavaScript specs (`Native*.js`, `*NativeComponent.js`); their native counterparts are generated at build time.
57- Feature flags are declared in `packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js`; `yarn featureflags` regenerates the JavaScript, Java, and C++ accessors.
58- JavaScript sources are typed with Flow, and the public API is exported from `packages/react-native/index.js`. TypeScript types are generated from those sources, and `packages/react-native/ReactNativeApi.d.ts` is a committed snapshot of that API — run `yarn build-types` to regenerate both whenever the public API changes, then `yarn test-generated-typescript` to type-check the result.
59- The public native API is snapshotted as well: C++ under `scripts/cxx-api` (`yarn cxx-api-build`), and Android in `packages/react-native/ReactAndroid/api/ReactAndroid.api`.
60- `CHANGELOG.md` is compiled at release time from pull request descriptions.
61
62## Contributing guidelines
63
64- Keep each change focused — no unrelated refactors, formatting, or dependency updates.
65- Complete the pull request template — the motivation and the user-visible effect, and a [changelog entry](https://reactnative.dev/contributing/changelogs-in-pull-requests) with its category and type tags.
66- In the test plan, give the exact commands you ran and their results, plus screenshots or a video for user-interface changes. Say which checks you could not run.
67
68The full process is on [reactnative.dev](https://reactnative.dev/contributing/overview).
69
The rest of the repository
react/react-native ships 1 other instruction files
This listing
Whoever runs react/react-native can claim it
This is yours? Claim this config and we will write to you when the measurement moves. The check is one token placed where only you can place it, and there is no account and no password.