How do React Native's precompiled iOS binaries speed up builds since 0.84, and when would you set RCT_USE_PREBUILT_RNCORE=0?
answer
- xcframeworks instead of compiling core
- downloaded during pod install
- default since 0.84, opt-in in 0.81
- RCT_USE_RN_DEP covers Folly and friends
- =0 to build core from source
basics
~20 sSince 0.84, pod install downloads React Native core and its dependencies as precompiled xcframeworks, so clean iOS builds skip compiling them. Set RCT_USE_PREBUILT_RNCORE=0 to build core from source, for example to patch it or opt out of Hermes V1.
solid answer
~40 sA clean iOS build used to compile all of React Native's C++ and Objective-C from source. React Native 0.80 started shipping its third-party dependencies, like Folly and glog, prebuilt behind `RCT_USE_RN_DEP=1`; 0.81 added an experimental prebuilt React Native core behind `RCT_USE_PREBUILT_RNCORE=1`, with the release post quoting up to 10x faster compiles; and 0.84 made both the default. During `pod install` the scripts download `.xcframework` tarballs from Maven and install them instead of the sources. I set `RCT_USE_PREBUILT_RNCORE=0 bundle exec pod install` when I need core built from source: to opt out of Hermes V1, to re-enable legacy-architecture code with `RCT_REMOVE_LEGACY_ARCH=0`, to apply a patch to React Native's native code, or to step into React Native internals in the debugger, which prebuilt binaries don't allow.
code
bash · 11 lines# Default in 0.84+: prebuilt React Native core and dependencies
cd ios && bundle exec pod install
# Build React Native core from source (for example, to patch it)
RCT_USE_PREBUILT_RNCORE=0 bundle exec pod install
# Re-enable legacy-architecture code, which needs a source build
RCT_USE_PREBUILT_RNCORE=0 RCT_REMOVE_LEGACY_ARCH=0 bundle exec pod install
# Download prebuilt artifacts from an internal Maven mirror
ENTERPRISE_REPOSITORY=https://maven.internal.example/ bundle exec pod installgo deeper
Know that since 0.84 pod install downloads React Native core as precompiled binaries, so clean iOS builds compile much less.
Explain RCT_USE_RN_DEP versus RCT_USE_PREBUILT_RNCORE, what stays source-built, and the cases that need RCT_USE_PREBUILT_RNCORE=0.
Show how you audit CI and team setups for stale flags, handle patches and source builds deliberately, and point downloads at a mirror.
Weigh the dependency on published binaries against build speed: mirroring, reproducibility, and when a team should build core from source.
## What used to happen on every clean iOS build A React Native iOS app depends on a large amount of native code: React Native core (Fabric, Turbo Modules, the runtime, the Hermes integration) plus third-party C++ libraries such as **Folly** and **glog**. CocoaPods used to install all of it **as source**, so every clean build — a new machine, a CI runner, a deleted DerivedData folder — compiled it from scratch. On many projects that was most of the build. ## How precompiled binaries arrived | Release | Change | How to enable | |---|---|---| | 0.80 | third-party dependencies prebuilt | `RCT_USE_RN_DEP=1` at `pod install` (experimental) | | 0.81 | React Native core prebuilt too | `RCT_USE_RN_DEP=1 RCT_USE_PREBUILT_RNCORE=1` (experimental) | | 0.84 | both on by default | nothing; set to `0` to opt out | In 0.87 the pods script sets both variables to `1` unless you explicitly pass `0`. During `pod install` it downloads **`.xcframework`** tarballs of React Native core and its dependencies — published on Maven with each release — and installs them as pods in place of the sources. The 0.81 release post described compile times cut **by up to 10x** in projects where React Native is the main dependency; the 0.80 post measured dependencies alone at roughly 12% faster. ## What stays source-built - **Your own code** — Swift and Objective-C in your app target. - **Third-party native modules** from npm, which still compile from their pods. - **Anything you opted out of**, below. So the gain is largest for apps where React Native itself dominates the native code, and smaller for apps with many heavy native libraries. ## How the prebuilt pods are wired In prebuilt mode the pods scripts still declare React Native's usual core pods, but as **facades** without sources or headers, so they cannot shadow the binary; the code and headers come from a `React-Core-prebuilt` pod that wraps the downloaded xcframework. Two practical consequences: - **You can tell which mode you are in** from the `pod install` output, which logs that it is using the prebuilt React Native Core and Dependencies, and from the installed pods, which include `React-Core-prebuilt`. - **Flags are read at `pod install` time.** Changing `RCT_USE_PREBUILT_RNCORE` or `RCT_USE_RN_DEP` does nothing until you run `pod install` again; a team can pin the choice for everyone with an `ENV['RCT_USE_PREBUILT_RNCORE'] = '0'` line near the top of the Podfile, the pattern the 0.80 release post showed for `RCT_USE_RN_DEP`. ## When to set `RCT_USE_PREBUILT_RNCORE=0` Build core from source when the prebuilt binary cannot be what you need: 1. **Opting out of Hermes V1** — the 0.84 notes pair `RCT_HERMES_V1_ENABLED=0` with `RCT_USE_PREBUILT_RNCORE=0`. 2. **Re-enabling legacy-architecture code** on iOS — `RCT_USE_PREBUILT_RNCORE=0 RCT_REMOVE_LEGACY_ARCH=0 bundle exec pod install`. 3. **Patching React Native's native sources** — a patch to files that are no longer compiled has no effect. 4. **Stepping into React Native internals** in the debugger — prebuilt binaries let you debug your own native code, not React Native's. `RCT_USE_RN_DEP=0` similarly forces the third-party dependencies back to source. ## Trade-offs to keep in mind - **You depend on published artifacts.** A clean `pod install` needs the matching tarballs to be downloadable, from Maven Central or your mirror. - **Everyone should use the same mode.** A developer on a source build and CI on binaries are debugging different code. - **Debugging stops at React Native's boundary.** Your own native code is debuggable; React Native's internals are not, unless you switch to a source build. ## Working with a mirror The download URL defaults to Maven Central. Setting the **`ENTERPRISE_REPOSITORY`** environment variable points the pods scripts at your organisation's mirror instead, as long as it mirrors Maven's layout — the iOS counterpart of Android's `exclusiveEnterpriseRepository` Gradle property. ## Common mistakes - **A leftover `RCT_USE_PREBUILT_RNCORE=0`** in a CI script or the Podfile from an old workaround, silently compiling core on every build. - **Patching React Native's iOS sources with prebuilt binaries on** and wondering why the patch does nothing. - **Expecting prebuilt binaries to speed up your own Swift code** or third-party native modules. - **Mixing flags across a team**, so developers debug different binaries than CI ships. Precompiled core also changes what `ccache` can save on iOS: with less React Native C++ compiled locally, a compiler cache has less to reuse, so measure before adding one.
- You applied a patch to React Native's iOS sources but the app behaves as before. What is the likely cause?Since 0.84 the pods install React Native core as a precompiled xcframework, so the patched source files are never compiled. Re-run `RCT_USE_PREBUILT_RNCORE=0 bundle exec pod install` so core is built from source with your patch, and make sure CI uses the same flag.
- Why can precompiled iOS core make ccache less valuable?ccache saves time by reusing previously compiled objects. With React Native core and its dependencies arriving as prebuilt xcframeworks, far less C++ is compiled locally, so there is less for the cache to reuse. It can still help apps with heavy native modules or core built from source — measure hit rates with `ccache -s`.
saying these in an interview costs you the question
- Prebuilt binaries still have to be enabled by hand in 0.87
- Prebuilt core also precompiles your own Swift code and native modules
- Patches to React Native's iOS sources apply with prebuilt core enabled
- You can step into React Native internals with prebuilt binaries
- The xcframeworks are generated locally on the first pod install