Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52378
This adds a Gradle property called `exclusiveEnterpriseRepository`
that users can set in their `android/gradle.properties` as such:
```diff
# Use this property to enable or disable the Hermes JS engine.
# If set to false, you will be using JSC instead.
hermesEnabled=true
+exclusiveEnterpriseRepository=https://my.internal.proxy.net/
```
This will remove all the existing Maven repositories and only use the internal mirror they have.
Changelog:
[Android] [Added] - RNGP - Add support for `exclusiveEnterpriseRepository` to specify an internal Maven mirror.
Reviewed By: mdvacca
Differential Revision: D77667573
fbshipit-source-id: 835004d2ae7aa4e250b6f7a88a41918b573f5bd5
Summary:
This React Native Android fix hardens the Fabric `InteropUiBlockListener` against `ConcurrentModificationException` crashes in `willMountItems` and `didMountItems`. By iterating over a shallow copy of the UI‐block lists and catching any mid‐iteration mutations, we ensure the listener never throws during a UI frame and always clears its pending blocks.
The issue was first reported in [React Native Issue https://github.com/facebook/react-native/issues/49783](https://github.com/facebook/react-native/issues/49783), and although [React Native PR#50091](https://github.com/facebook/react-native/pull/50091) was closed and not merged, the work in that PR did make it to React Native in [commit 17da3cb](https://github.com/facebook/react-native/commit/17da3cbbf4687f86226c4a80297c4d8abfc9c4f5). However, the fix didn't go far enough. We saw intermittent examples of this exception being thrown when swiping through a carousel from `react-native-reanimated-carousel`. This fix goes right to the exception site itself.
## Changelog:
[ANDROID] [FIXED] - Hardened the Fabric `InteropUiBlockListener` against `ConcurrentModificationException` crashes in `willMountItems` and `didMountItems`
Pull Request resolved: https://github.com/facebook/react-native/pull/51631
Test Plan:
The only way to test this is to develop a standalone app that emulates what we've been seeing in our commercially available RN app. We have done extensive testing of before (intermittent crashes) and after the fix (no crashes) and things have been standing up very well for us.
Here is a the Red Box we see right at the time of the crash, before this fix:
<img width="414" alt="image" src="https://github.com/user-attachments/assets/8d1b6c6d-42f7-48a0-9574-2f05436547d4" />
And here is the beginning of the logcat crash log:
```
2025-05-07 16:01:49.212 unknown:BridgelessReact com.aura.suite W ReactHost{0}.handleHostException(message = "null")
2025-05-07 16:01:49.212 unknown:ReactNative com.aura.suite E Exception in native call
java.util.ConcurrentModificationException
at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1111)
at java.util.ArrayList$Itr.next(ArrayList.java:1064)
at com.facebook.react.fabric.internal.interop.InteropUIBlockListener.willMountItems(InteropUiBlockListener.kt:72)
at com.facebook.react.fabric.FabricUIManager$MountItemDispatchListener.willMountItems(FabricUIManager.java:1235)
at com.facebook.react.fabric.mounting.MountItemDispatcher.dispatchMountItems(MountItemDispatcher.java:184)
at com.facebook.react.fabric.mounting.MountItemDispatcher.tryDispatchMountItems(MountItemDispatcher.java:122)
at com.facebook.react.fabric.FabricUIManager$3.runGuarded(FabricUIManager.java:820)
at com.facebook.react.bridge.GuardedRunnable.run(GuardedRunnable.java:29)
at com.facebook.react.fabric.FabricUIManager.scheduleMountItem(FabricUIManager.java:824)
at com.facebook.react.fabric.FabricUIManagerBinding.reportMount(Native Method)
at com.facebook.react.fabric.FabricUIManager$MountItemDispatchListener$1.run(FabricUIManager.java:1282)
at android.os.Handler.handleCallback(Handler.java:959)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8592)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)
```
All of this goes away with this fix. We're using React Native 0.79.2 and this is the first time we've open a PR for react-native. I hope this is enough info as far as testing goes.
Can we see a 0.79.x release with this fix, please?
Reviewed By: Abbondanzo, cortinico
Differential Revision: D75594791
Pulled By: javache
fbshipit-source-id: 982ae27e89756fdb290a24b0bdfa67c2e47c04e3
Summary:
FIXED Add index.js.flow to npm package files for Flow support
Currently, the distributed npm package for react-native does not include the index.js.flow file, which causes all exports to be typed as any when using Flow. This commit adds index.js.flow to the "files" array in package.json, ensuring Flow users receive proper type definitions out of the box. This addresses issues where type checking with Flow fails in React Native projects.
## Changelog:
[General][Added] Publish top-level Flow types for `react-native`
Pull Request resolved: https://github.com/facebook/react-native/pull/51908
Reviewed By: huntie, necolas
Differential Revision: D76292301
Pulled By: robhogan
fbshipit-source-id: e56360d3f35af30ef160470181349aac1812e7c1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52035
Fixes https://github.com/facebook/react-native/issues/52014
Some OSS library is still returning null for `getViewManagerNames` especially if they're
implementing the `ViewManagerOnDemandReactPackage` in Java.
I'm adding a try-catch here so that we prevent the NPE for those scenarios.
Changelog:
[Android] [Fixed] - Fix crash on ReactInstance due to null returned for getViewManagerNames
Reviewed By: javache
Differential Revision: D76723826
fbshipit-source-id: cc159dee389257c6877b03a67840a45ee5bec165
Summary:
After testing the latest RC and nighly builds, crash appeared when emitting events from turbo modules on 32bit Android devices. The crash is always reproducible only on 32bit devices on signed production builds. Fore more details and the crash log, check the [related issue](https://github.com/facebook/react-native/issues/51628#issue-3094045077).
From what I found, the variadic functions like CallVoidMethod are unsafe on 32bit due to not type checking the passed arguments at compile time. As far as I understand the 64bit cpus and ABIs are more forgiving with alignment and calling conventions. On 32bit the ABIs are strict as arguments are passed on the stack and if there is type/size/alignment issue it reads the wrong memory, which causes the SIGEGV crashes.
## Changelog:
[ANDROID] [FIXED] - emitting event from turbo module crashes on 32bit android
Pull Request resolved: https://github.com/facebook/react-native/pull/51695
Test Plan:
1. Pull the [reproduction demo](https://github.com/vladimirivanoviliev/rn079eventcrash), install the dependencies (v `0.80` is on PR)
2. Run codegen on android
3. Build signed apk. To create it you will need to create new demo key-store.
4. To install the build apk in 32bit mode you can use `adb -s YOURDEVICE install --abi armeabi-v7a android/app/release/app-release.apk`
5. Run the app, create key, save it. Than update the key and save it again. The app crashes when try to emit event from the turbo module.
6. Patch the related `JavaTurboModule.cpp` file with the changes from this PR and enable build from source.
7. Rebuild and reinstall the apk and test again - the issue is now fixed
## Additional notes:
I have tested the app on android using the `rn-tester` demo app, everything works as expected. I also patched our production app and tested more complex scenarios and they works as expected. I have run the tests and linter and they passed.
One thing that I didn't able to setup and run is the iOS `rn-tester` app, due to Hermes engine error `Command PhaseScriptExecution failed with a nonzero exit code`. I haven't found any information how to fix it. I have followed [this guide](https://github.com/facebook/react-native/blob/main/packages/rn-tester/README.md) and installed node modules using yarn and started the `yarn prepare-ios`. I also haven't found any information with what node version and ruby version the react native package is build on CI so I use the same versions locally. If you provide me with updated instructions for those I can contribute by updating the related guides and including `.npmrc`, `.ruby-version` files.
Reviewed By: cortinico
Differential Revision: D75782377
Pulled By: javache
fbshipit-source-id: b94998be6dd51e90ad4137b1d2e38a6850bc3cb2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51530
Alternative to https://github.com/facebook/react-native/pull/50784.
`__mocks__` (and other underscored dirs) are correctly excluded from our npm package via `package.json#files`. But in this instance, this is a source file for the `jest/` directory (Jest preset within `react-native`), and should be included — fix by relocating.
Changelog:
[General][Fixed] - Fix missing RefreshControlMock source in Jest preset
Reviewed By: rshest
Differential Revision: D75215731
fbshipit-source-id: 1240344c4236288f31b16513f4df16766ad1e571
Summary:
Due to us moving to central.sonatype.com for publishing, we cannot publish and release the Maven repository in 2 distinct invocations.
This consolidates all the publishing job to happen during build_npm_package
Changelog:
[Internal] [Changed] -
Reviewed By: fabriziocucci
Differential Revision: D76888543
fbshipit-source-id: 3cb0db6176ed2221a12b4f3f1f575232aa006a6c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52004
This is necessary because the snapshots are now going to be published on a different repository:
central.sonatype.com.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D76596802
fbshipit-source-id: 424fb1134e41502d53b76209fba325c895c79ba8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51693
This moves React Native to use the Central Portal URLs rather than the legacy OSSRH ones.
See https://github.com/gradle-nexus/publish-plugin for more context.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D75673984
fbshipit-source-id: 1de6746809eed72f232eac0c3fb4d809c2046620
Summary:
PR https://github.com/facebook/react-native/issues/51078 Implemented finding disabled libraries but the code (below) didn't actually filter any libraries out because destructured name is `undefined`. This pr adds the name to codegenEnabledLibraries so filtering would work.
```js
const libraries = codegenEnabledLibraries.filter(
({name}) => !disabledLibraries.includes(name),
);
```
## Changelog:
[IOS] [FIXED] - Skip codegen for selectively disabled libraries in react-native.config.js
Pull Request resolved: https://github.com/facebook/react-native/pull/51838
Test Plan:
1. Install a library that has the componentProvider field set in the codegen config (for example: react-native-safe-area-context and react-native-screens or see [reproducer](https://github.com/aattola/rn-codegen-exclude))
2. Exclude library with react-native.config.js
3. install pods / run codegen
4. Check that codegen actually excluded the specified dependencies from: `ios/build/generated/ios/RCTThirdPartyComponentsProvider.mm`
Rollback Plan:
Reviewed By: cortinico
Differential Revision: D76044622
Pulled By: cipolleschi
fbshipit-source-id: 9e70c2a263c750edb1ea95305c9e5e178e2ce8d8
Summary:
There is an edge case in the codegen `findRCTComponentViewProtocolClass` function where the parsing of the Component Class will fail if there is another `.class` call in the same file after the `Class<RCTComponentViewProtocol>` function. This ends up resulting in a `RCTThirdPartyComponentsProvider.mm` file that looks like the image bellow
<img width="1052" alt="image" src="https://github.com/user-attachments/assets/26ce93be-0370-4852-a949-9da21762ff7f" />
You can reproduce this with the following
```
Class<RCTComponentViewProtocol> XYZCls(void)
{
return XYZ.class;
}
// this comment breaks codegen .class
```
## Changelog:
[IOS] [FIXED] - Fix codegen extracting `.class` from complex component classes
Pull Request resolved: https://github.com/facebook/react-native/pull/51813
Test Plan: Run codegen locally, use this patch in the expo/expo repo and CI should be green
Reviewed By: cipolleschi
Differential Revision: D75964424
Pulled By: cortinico
fbshipit-source-id: 50e45aa2ac6e43c75ee6fdd76791c591d81d4df7
Summary:
https://github.com/facebook/react-native/pull/49927 introduced a regression where a Ruby script would read compilation artifacts and fail, when the user has relative build directories set in XCode.
After successful compilation `build/` dir and `DerivedData/` dir have `.plist` files that aren't in UTF-8 encoding and shouldn't be read by the script. If the user tries to reinstall pods at this point, he gets the following error:

This is how you enable relative build directories in XCode.

## Changelog:
[IOS] [FIXED] - Ignore `build/` and `DerivedData/` directories when reading `.plist` files.
Pull Request resolved: https://github.com/facebook/react-native/pull/51833
Test Plan: After applying this patch the problem doesn't occur anymore on my machine.
Reviewed By: cortinico
Differential Revision: D76030133
Pulled By: cipolleschi
fbshipit-source-id: 7ae8c2d0ce28b6925245a9172154e3dcafee126f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51602
Changelog: [GENERAL][FIXED] - Fixed the generated type definitions for `Animated.FlatList` and `Animated.SectionList` to correctly infer item types.
Current definitions for animated list components cast away their generic definitions, preventing the types to be inferred from usage. This diff addresses that.
Reviewed By: huntie
Differential Revision: D75407762
fbshipit-source-id: c86f20298ded707971c05a78d025a63e82fe2a64
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51699
Re-expose **all `"./src/*"` paths via `package.json#exports`.
Follows D72228547 — as we'd attempted to be proactive with hiding `src/`, but are now reverting — essentially reducing this change as much as possible (read: most defensive/safer effect on OSS).
**Motivation**
Mitigates a warning emitted by Metro that may surface in new bare React Native template projects.
{F1978757796}
This is due to a 1P reference to `'react-native/src/private/featureflags/ReactNativeFeatureFlags` in `react-native/virtualized-lists`.
This is enough motivation to undo part of our change with introducing `"exports"` on `react-native` in 0.80.
**Especially**, to avoid confusion with other warnings we've intentionally introduced in 0.80 around subpath imports.
- The key difference is the above screenshot is from Metro and covers **any** import from any `node_modules` file — as opposed to just the immediate project.
Changelog:
[General][Changed] - Re-expose `src/*` subpaths when not using the Strict TypeScript API
The net breaking change for 0.80, once picked, is simply the presence of `"exports"` (only very edge case effects on expanding per-platform extensions, which we've mitigated). **All exported paths equivalent**.
Reviewed By: robhogan
Differential Revision: D75682566
fbshipit-source-id: f90c7298279c6be3a4eab70f2dfdc618ffcf1124
Summary:
In https://github.com/facebook/react-native/pull/50734, `LayoutAnimationController` was migrated to Kotlin and all of its methods are now marked as final.
However, this class is used and extended by `react-native-reanimated` in order to provide Layout Animations for Android on the Old Architecture. With all its methods being marked as final, the builds are failing.
This PR restores the possibility to extend `LayoutAnimationController`.
## Changelog:
[ANDROID] [FIXED] - Restored the possibility to extend `LayoutAnimationController`
Pull Request resolved: https://github.com/facebook/react-native/pull/51479
Test Plan: I've checked that this PR fixes build errors caused by `LayoutAnimationController` in react-native-reanimated.
Reviewed By: cipolleschi, mdvacca
Differential Revision: D75079557
Pulled By: cortinico
fbshipit-source-id: beeb700cbad87362dda4b60941124562c4753815
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51496
Fixes problem with generics passed to `VirtualizedSectionList` in generated types. The `flow-api-translator` creates a re-declaration for `export default` variables which shadows generics.
Changelog:
[Internal]
Reviewed By: huntie
Differential Revision: D75141051
fbshipit-source-id: 260ef066038320eee3ffa93692f77f1eff5c9205
Summary:
Calls to create timers should return sequential ids (integers greater than zero in the spec's words). This regressed in the `TimerManager` implementation, which instead starts at zero inclusively.
This has two side-effects for code assuming a spec-compliant implementation of `setTimeout` and `setInterval`:
- Calls to `clearTimeout(0)` or `clearInterval(0)` will potentially cancel scheduled timers, although it's supposed to be a noop
- Predicates like `if (timeoutId)` will fail since they assume non-negative ids
The change in this PR is to align with WHATWG HTML 8.6.2 (Timers): https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers
> otherwise, let id be an [implementation-defined](https://infra.spec.whatwg.org/#implementation-defined) integer that is **greater than zero** and does not already [exist](https://infra.spec.whatwg.org/#map-exists) in global's [map of setTimeout and setInterval IDs](https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#map-of-settimeout-and-setinterval-ids).
Specifically,
- we should return `0` to indicate that no timer was scheduled
- we should start generating timer IDs at `1` instead of `0`
This was previously raised in review comments here: https://github.com/facebook/react-native/pull/45092/files#r1650790008
The spec-incompliant behaviour was raised in an issue here: https://github.com/apollographql/apollo-client/issues/12632#issue-3075269978
This PR does not,
- add bounds checking on `timerIndex_` and add a search of an available id that isn't in the unordered map
- exclude `0` from being an accepted `TimerHandle` in `TimerManager::createTimer` or `TimerManager::deleteTimer` since the above bounds checking hasn't been added either
## Changelog:
[GENERAL] [FIXED] - Align timer IDs and timer function argument error handling with web standards.
Pull Request resolved: https://github.com/facebook/react-native/pull/51500
Test Plan:
- Run `setTimeout` / `setInterval`; before applied changes the timeout for the first timer will be `0`
- Run `setTimeout(null)`; before applied changes the timer ID will be non-zero
- Run `setInterval(null)`; before applied changes an error will be thrown rather than `0` being returned
Reviewed By: cipolleschi
Differential Revision: D75145909
Pulled By: rshest
fbshipit-source-id: 6646439abd29cf3cfa9e5cf0a57448e3b7cd1b48
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51338
There was some problems removing this feature flag earlier in that, on older android versions, we would try to focus the top most text input whenever any other text input would try to blur. This was ultimately and issue with how Android implements `clearFocus`. To fix this, lets block the focusability of all views while we clear the focus, then re-enable.
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D74760594
fbshipit-source-id: 2811c08ad6ed0855da0a4d7fca89fb08f84905c2
Summary:
I noticed the link to networking in new app screen is wrong. So correcting it here
## Changelog:
[GENERAL][FIXED] - Fix Networking URL in New app screen
Pull Request resolved: https://github.com/facebook/react-native/pull/51396
Test Plan: Click on the link to open
Reviewed By: arushikesarwani94
Differential Revision: D74886240
Pulled By: cortinico
fbshipit-source-id: 19ccf63e64f0e40df4a0ab4082299c654926e35d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51382
This diff replaces `dtslint` which is obsolete and [It is not intended to be used on its own, but as part of the definitelytyped set of packages](https://github.com/microsoft/dtslint) in favor of `tsc` type tests.
It's probably not necessary to have `test-typescript-offline` as tsc does that out of the box but doesn't test with multiple TS versions.
Changelog:
[Internal]
Reviewed By: huntie
Differential Revision: D74804967
fbshipit-source-id: 4c581ba5debf6fd0bb8dcddbb95f3c85b05082d4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51383
This diff is a set of alignments/improvements in generated TS types. It includes:
- extending `AppStateStatus` with `extension` and `unknown`,
- exporting `AnimatedProps` under `Animated` namespace,
- resolving issue with discriminated unions in `ProgressBarAndroidTypes`,
- fixing `StyleSheet.create` type to accept only specified style properties,
- extending `TextProps` with `AccessibilityProps`,
extending Fn Args generic with `$ReadOnlyArray` in `ErrorUtils`,
- small `__typetests__` adjustments,
- removing type test `styleDimensionValueValidAnimated` as `DimensionValue` no longer accepts `AnimatedNode`,
- removing `styleDimensionValueInvalid` as `DimensionValue` accepts any string now - template literal types in Flow are not supported,
- changing `overlayColor` type to `ColorValue` to align with manual types,
- fixing `AnimatedPropsAllowList` type which wasn't correct in TS because index signature type was different from style type,
- using `DeviceEventEmitter` instead of `DeviceEventEmitterStatic` in type tests which is equivalent in both new and old types - `DeviceEventEmitterStatic` was only a type of `DeviceEventEmitter`,
- removing type test for checking forwarded key type - doesn't work with new types and that shouldn't be supported,
- removing `Animated.legacyRef` type test - not included in new types,
- adding `DOMRect` from "dom" lib to `globals.d.ts` to not include "dom" lib in the tsconfig - tries to compare globals with `lib.dom.d.ts` and produces many errors,
- exporting `SectionListData`,
Changelog:
[Internal]
Reviewed By: huntie
Differential Revision: D74807552
fbshipit-source-id: c5254ea0f701f3602b9d716faeb50ca1ab21b013
Summary:
Expo is using the backingmap to be able to update properties in a fast and performant way in two overridden view manager subclasses (ViewGroupManager subclass is one of them).
This diff exposes the backing field via JvmName using the `internal_` prefix.
So Expo can keep on accessing the field as they were doing before. In the long run we should prevent them from accessing this property altogether but this would require a different API.
## Changelog:
[INTERNAL] -
Pull Request resolved: https://github.com/facebook/react-native/pull/51386
Test Plan: Build with Expo modules
Reviewed By: cipolleschi
Differential Revision: D74884533
Pulled By: cortinico
fbshipit-source-id: e76673c794a6a125059633d29445d991d867b770
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51285
The `composeStyles` function should correctly determine the type of the input styles (`ViewStyle`, `ImageStyle`, `TextStyle`) base on the output type:
```ts
const combinedStyle8: StyleProp<ImageStyle> = StyleSheet.compose(
// ts-expect-error
composeTextStyle,
composeTextStyle,
);
```
This diff adds generic type checking for `compose` function and fixes `ImageStyle` overflow prop type which accepted `scroll` property (which wasn't previously accepted in manual types) and which enables type system to distinguish `ImageStyle` from `ViewStyle` and `TextStyle`:
previous:
```ts
overflow?: 'visible' | 'hidden' | 'scroll'
```
current:
```t
overflow?: 'visible' | 'hidden'
```
Changelog:
[Internal]
Reviewed By: huntie
Differential Revision: D74574293
fbshipit-source-id: 751a44f2d3cd43055d93031343995f16ef87b185