Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52946
This just add a set of unit tests for `DisplayMetricsHolder` as I'm working on this class recently.
Changelog:
[Internal] [Changed] -
Reviewed By: rshest, mdvacca
Differential Revision: D78981753
fbshipit-source-id: 5800d44d3131a58770a0049eb2d08306874b7183
Summary:
There is currently a bug with Modals with New Architecture where the first frame is rendered incorrectly, specifically not accounting for all the vertical insets (only the status bar). This fixes it.
Specifically:
1. I've removed the caching of the statusbar height from `ReactModalHostView` as that was not working correctly. Sometimes the value returned `0` meaning that it was not yet computed when Fabric was asking for it. In the updated implementation we now query `FabricUIManager` given the `surfaceId` of the modal.
2. I've modified the logic to account for all the vertical insets, not just the status bar.
## Changelog:
[ANDROID] [FIXED] - Correctly account for insets on first render of Modals on New Arch
Pull Request resolved: https://github.com/facebook/react-native/pull/52835
Test Plan:
Tested on Marketplace Location Picker and the picker is still working correctly:
https://pxl.cl/7NjtJ
Reviewed By: mdvacca
Differential Revision: D78975126
Pulled By: cortinico
fbshipit-source-id: d7afb4fa5d2f43a7e33da3860432fa6dfe0dc8d7
Summary:
This test was still using the old `BridgeReactContext`, I'm migrating it to `BridgelessReactContext`.
## Changelog:
[INTERNAL] -
Pull Request resolved: https://github.com/facebook/react-native/pull/53131
Test Plan: CI
Reviewed By: mdvacca
Differential Revision: D79801564
Pulled By: cortinico
fbshipit-source-id: 9bb96185505703a773597aeadfeeaeeb194532de
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52978
This field is never written anywhere (neither in the internal codebase, nor in OSS).
I'm cleaning this us and simplifying the logic:
- Deprecating `effectiveLineHeight`
- Replacing all the usage of `effectiveLineHeight` with just `lineHeight`
Changelog:
[Android] [Changed] - Deprecate the field `TextAttributeProps.effectiveLineHeight`. This field was public but never used in OSS.
Reviewed By: mdvacca
Differential Revision: D79442393
fbshipit-source-id: c424a6def0257264cd160a2d7be48c2d0f47135e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53137
One of those 2 methods can be deprecated as it was used only for old architecture.
We'll be removing it at some point in the future.
Changelog:
[Android] [Deprecated] - DefaultDevSupportManagerFactory.create() method used for Old Arch
Reviewed By: rshest
Differential Revision: D79806116
fbshipit-source-id: ad2d5515f93bb85e3b7c495b369078f4c66d143b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53133
# Changelog:
[Internal] -
As part of the ongoing effort to migrate the React Native codebase to Kotlin, this PR introduces the initial setup required for Kotlin support in Yoga.
- Added initial basic Kotlin configuration to the project.
- Migrated `YogaConstants` as an initial file to try out the first migration steps.
X-link: https://github.com/facebook/yoga/pull/1829
Test Plan:
- Tested the migrated class directly against facebook/react-native, see the PR [here](https://github.com/facebook/react-native/pull/52998).
- Run: `./gradlew :yoga:assembleDebug` & `./gradlew :yoga:compileDebugSources`
I am not able to run the Java tests in this repo (even before the initial Kotlin setup) – not sure if I am missing something there but any pointers are welcome – it seems like there is some missing configuration. Currently trying with `./gradlew :yoga:test`
Reviewed By: cortinico
Differential Revision: D79545992
Pulled By: rshest
fbshipit-source-id: 8257ff53e6b6f2436980be98b6c94e1ac526b207
Summary:
This PR (initially created for edge-to-edge opt-in support, rebased multiple times) fixes the `Dimensions` API `window` values on Android < 15, when edge-to-edge is enabled.
Currently the window height doesn't include the status and navigation bar heights (but it does on Android >= 15):
<img width="300" alt="Screenshot 2025-06-27 at 16 23 02" src="https://github.com/user-attachments/assets/c7d11334-9298-4f7f-a75c-590df8cc2d8a" />
Using `WindowMetricsCalculator` from AndroidX:
<img width="300" alt="Screenshot 2025-06-27 at 16 34 01" src="https://github.com/user-attachments/assets/7a4e3dc7-a83b-421b-8f6d-fd1344f5fe81" />
Fixes https://github.com/facebook/react-native/issues/47080
## Changelog:
[Android] [Fixed] Fix `Dimensions` `window` values on Android < 15 when edge-to-edge is enabled
Pull Request resolved: https://github.com/facebook/react-native/pull/52738
Test Plan:
Run the example app on an Android < 15 device.
Rollback Plan:
Reviewed By: cipolleschi, Abbondanzo
Differential Revision: D78738516
Pulled By: alanleedev
fbshipit-source-id: fdb22f3cc76b0bda987db426cb015124bcacdc84
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53041
update `DisplayMetricsHolder.getWindowDisplayMetrics()` to `getScreenDisplayMetrics()`.
Where window width and height is not needed, prefer to use `screenDisplayMetrics` as with upcoming diff `windowDisplayMetrics` initialization only happen using UiContext and have potential to cause more issues if used unnecessarily.
Changelog: [Internal] Update `DisplayMetricsHolder.getWindowDisplayMetrics()` to use `.getScreenDisplayMetrics()`
Reviewed By: mlord93
Differential Revision: D79571226
fbshipit-source-id: d90fca36c119318e7a2dfa6953fc2148b35e83d4
Summary:
Refactors the window focus detection feature flag logic in `VirtualView` (Android) to eliminate one instance property and instead utilize the existence of the focus listener to determine whether window focus detection is enabled.
Changelog:
[Internal]
Reviewed By: mdvacca
Differential Revision: D79743782
fbshipit-source-id: d12e70d8e52b72d546ff097c3b1bcfbd29fb9129
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52838
**Context**
Experimental V2 Performance Monitor prototype, beginning by bringing the [Interaction to Next Paint (INP)](https://web.dev/articles/inp) metric to React Native.
**This diff**
Wires up a client/subscriber for the `"__chromium_devtools_metrics_reporter"` runtime binding (to which we emit live metrics events since D78904748). This will be used to unpack these performance updates to send to the host platform.
- Creates a new `HostRuntimeBinding` helper, which establishes a local/private CDP session.
- Conditionally installs our perf metrics runtime binding in `HostTarget` when `perfMonitorV2Enabled` is set.
- Wires up a new `onPerfMonitorUpdate` event on `HostTargetDelegate` (unimplemented until the next diff).
Changelog: [Internal]
Reviewed By: hoxyq
Differential Revision: D78904766
fbshipit-source-id: 991f17a4cc69f574917750053a5da31bbc6dc0d5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53055
Moves the C++ part of `InspectorNetworkReporter.kt` into the `react_devsupportjni` JNI library, and adds missing `SoLoader.loadLibrary` call.
Replaces D79568759 / https://github.com/facebook/react-native/pull/53036.
Changelog: [Internal]
Reviewed By: robhogan
Differential Revision: D79638331
fbshipit-source-id: 5df450ad80e4532d6ada1e4dab51a1de6418a4e0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53003
The new `onChildStartedNativeGesture` method accepts a nullable `ReactContext` value for the purpose of flushing active touch events. This change updates all callsites of that method to pass a `ReactContext`
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D79258727
fbshipit-source-id: 7b2950f514295dbe26822442c98079b8121cb3bf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52985
This class is essentially a wrapper of LayoutShadowNode with no extra logic added.
Let's remove it.
Changelog:
[Internal] [Changed] -
Reviewed By: alanleedev
Differential Revision: D79450688
fbshipit-source-id: 943e10e602cb9a5b77fca81e11d2333828b27813
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53025
It's now time to say goodbye to the Legacy Architecture :')
This change hardcodes the `newArchEnabled` property to true, and warns the users
if they're attempting to set it to false.
Changelog:
[Android] [Breaking] - Remove possibility to newArchEnabled=false in 0.82
Reviewed By: cipolleschi
Differential Revision: D78560296
fbshipit-source-id: ccfc45d2f7f21cc20e063cb901d76be3d41458d6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53033
This diff replaces the logic introduced in D72078450 to prevent `onPointerEnter`/`onPointerLeave` from firing when a button is pressed. The new approach trades off some complexity for reliability: instead of deferring `ACTION_HOVER_EXIT` handling to the next frame, we now suppress it immediately if any button is pressed (`buttonState != 0`). This simpler logic appears to work reliably on Quest devices, though it may behave differently on the Android emulator (something we’ll monitor).
The main reason for this change is that deferring ACTION_HOVER_EXIT introduces problems in newer Spatial React use cases, particularly when a single component hierarchy spans multiple roots. For example, when hovering between ReactSurfaceRoot and another root like VolumetricWindow, deferring ACTION_HOVER_EXIT can lead to incorrect enter/exit ordering:
* Cursor starts hovering over `ReactSurfaceRoot`
* Cursor moves to `VolumetricWindow`
* `ACTION_HOVER_EXIT` (`ReactSurfaceRoot`) — deferred
* `ACTION_HOVER_ENTER` (`VolumetricWindow`) — processed
* `ACTION_HOVER_EXIT` (`ReactSurfaceRoot`) — processed (too late)
This results in inconsistent hover state updates across roots, which this diff resolves by handling `ACTION_HOVER_EXIT` immediately when appropriate.
Changelog: [Internal]
Reviewed By: Abbondanzo
Differential Revision: D79504775
fbshipit-source-id: ea97bff48ddf4d3d09caf56ca29057c202b12409
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53022
Following D77799617, D77927896, updates `InspectorNetworkReporter.kt` to check `isDebuggingEnabled` internally and avoid work/communication over the JNI layer — to minimise impact on the Android Network stack.
Changelog: [Internal]
Reviewed By: hoxyq
Differential Revision: D78004462
fbshipit-source-id: 2bea2ee0592d68d1cb330ac82e8b3b227b54a675
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52989
Adds a call to `NativeAnimatedModule`'s `userDrivenScrollEnded` method whenever a scroll event completes a smooth scroll animation. This is necessary in cases where Animated events control any layout properties of children and we need to force the shadow tree to resync with the native tree. For example, if a scroll view's child transforms its scale based on the scrollX or scrollY properties and the user triggers a `scrollToOffset` or `scrollToIndex` call, we don't update the layout of that child until the next state change.
Changelog: [Android][Fixed] - Fixed an issue where shadow tree and native tree layouts mismatch at the end of a scroll event
Reviewed By: sammy-SC
Differential Revision: D79464176
fbshipit-source-id: fee5f1c522714dbcddf8836de291c05d10e6e90e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53024
This class is Legacy Arch and is not used in OSS. Let's make it internal.
Changelog:
[Internal] [Changed] -
Reviewed By: RSNara
Differential Revision: D79556615
fbshipit-source-id: d157fe8f04784038d64657c6d240b0c51e41d82d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52987
This class is unnecessary. Is also public for no real reason.
Instead we should use `ReactNoCrashSoftException` directly.
I'm not marking this as breaking as users hsould not be catching this class.
Changelog:
[Internal] [Changed] -
Reviewed By: mdvacca
Differential Revision: D79451567
fbshipit-source-id: 4d6f45b3006c79969fcf141002d34a72bf88901a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52988
This class should be marked as `LegacyArchitecture` while it was not.
Changelog:
[Internal] [Changed] -
Reviewed By: mdvacca
Differential Revision: D79451041
fbshipit-source-id: 62c5d35821e354ea851eaccac909bf6bd9157f09
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52995
Fabric retains views by ID when `JSTouchDispatcher` receives a touch event, but does not sweep these same views if a child native gesture is started between the `ACTION_DOWN` and `ACTION_UP` actions of the touch. As a result, we never end up calling into that view's manager's `onDropViewInstance` method and can't perform reliable teardown of the view since it's stuck in this "touched" state.
This is change adds a new condition to check if `JSTouchDispatcher` should sweep active touches when a child native gesture is started, and only applies the check to `ReactSurfaceView` to start. The check is also only enabled if the `sweepActiveTouchOnChildNativeGesturesAndroid` flag is set.
Changelog: [Internal]
Reviewed By: jehartzog
Differential Revision: D79230277
fbshipit-source-id: c15b888ec932319f1bda05b8ef5eec39e5d08710
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52972
Fabric retains views by ID when `JSTouchDispatcher` receives a touch event, but does not sweep these same views if a child native gesture is started between the `ACTION_DOWN` and `ACTION_UP` actions of the touch. As a result, we never end up calling into that view's manager's `onDropViewInstance` method and can't perform reliable teardown of the view since it's stuck in this "touched" state.
This is the first of a few changes to add a new feature flag `sweepActiveTouchOnChildNativeGesturesAndroid` to allow the `JSTouchDispatcher` to sweep active touches when a child native gesture is started. Running experiments internally to confirm that there are no unintended side effects from flushing the active touch.
Changelog: [Internal]
Reviewed By: jehartzog
Differential Revision: D79257465
fbshipit-source-id: 1ca79e77b21d8086c4df6753b16b1d8d922cd8d5
Summary:
This pull request resolves a critical accessibility bug on Android where custom `accessibilityActions` fail to execute when activated via TalkBack's swipe gestures.
**The Problem:**
- When a user focuses a component with custom `accessibilityActions` (like a `TouchableOpacity`), TalkBack correctly announces the action labels as the user swipes up or down.
- However, when the user double-taps to activate the selected action, TalkBack reports an "incompatible action," and the `onAccessibilityAction` event is never triggered.
**The Root Cause:**
The investigation revealed that the `ReactAccessibilityDelegate` was generating **new, unstable IDs** for custom actions on every UI update. This instability prevents the Android accessibility service from reliably tracking and invoking the selected action.
**The Solution:**
This change introduces a static, thread-safe cache (`ConcurrentHashMap`) within `ReactAccessibilityDelegate`. This ensures that each unique action name is mapped to a single, stable ID for the entire lifecycle of the application. This provides the consistency required by TalkBack to function correctly.
This addresses the issue described in https://github.com/facebook/react-native/issues/47268.
---
## Changelog:
[Android] [Fixed] - Stabilize custom accessibility action IDs to prevent "incompatible action" errors in TalkBack.
---
Pull Request resolved: https://github.com/facebook/react-native/pull/52724
Test Plan:
The fix was validated extensively using the RNTester app on a physical Android device and an Android emulator.
### Steps to Reproduce (Before Fix)
1. Enable TalkBack on an Android device.
2. Navigate to a `TouchableOpacity` component with several custom `accessibilityActions`.
3. Swipe up or down to cycle through the actions. TalkBack correctly announces them (e.g., "add to cart").
4. Double-tap to execute the selected action.
5. **Result (Bug):** TalkBack announces *"incompatible action"*, and the `onAccessibilityAction` event is not triggered.
### Validation Steps (After Fix)
1. Follow the same steps as above on the patched version.
2. **Result (Fixed):** After double-tapping, the `onAccessibilityAction` event is **correctly triggered** with the appropriate action name. The "incompatible action" issue is fully resolved.
*A screen recording demonstrating the successful fix can be provided if needed.*
Uploading fixed bugs view problems (1).mp4…
Fixes https://github.com/facebook/react-native/issues/47268
Reviewed By: jorge-cab
Differential Revision: D78737471
Pulled By: cipolleschi
fbshipit-source-id: 877b196597472ac6a4f6df81a05a43956fb34629
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52839
**Context**
Experimental V2 Performance Monitor prototype, beginning by bringing the [Interaction to Next Paint (INP)](https://web.dev/articles/inp) metric to React Native.
**This diff**
Adds and configures a `CdpMetricsReporter` class to report `InteractionEntry` live metrics over CDP via the `"__chromium_devtools_metrics_reporter"` runtime binding.
**Notes**
- Introduces a new `react/performance/cdpmetrics` package, and a listener API on `PerformanceEntryReporter` (both to avoid a `jni` dependency in `react/performance/timeline`).
Changelog: [Internal]
Reviewed By: rubennorte
Differential Revision: D78904748
fbshipit-source-id: c75971aba43d9929912b3d1dba7576c2a2342214
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52912
This diff throws an Exception if ReactApplication.reactNativeHost is not overriden. This field is deprecated and it will be deleted in the near future.
The goal of this diff is to be able to remove usages of reactNativeHost for classes that implement ReactApplication
changelog: [Android][Breaking] Throw Exception if ReactApplication.reactNativeHost is not overriden
Reviewed By: mlord93
Differential Revision: D79186336
fbshipit-source-id: 9f8f34739c0f04056ff3d795bda45bc0dbca7624
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52901
I'm removing this class as we should not expose it publicly.
It's not used at all inside react-native and can potentally be moved internally.
The only usage I've found in OSS is patched with this PR:
- https://github.com/fabOnReact/react-native-wear-connectivity/pull/46
Changelog:
[Android] [Removed] - Remove the `com.facebook.react.bridge.JSONArguments` class
Reviewed By: javache, mdvacca
Differential Revision: D78265165
fbshipit-source-id: 704575e7b9cfd6d40980511d6064d39991b3eb48
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52885
Since we recently touched the `MatrixMathHelper` class, as we're looking into moving more matrix operations from Kotlin to C++,
I'm going to add more tests to make sure that those matrix math function are behaving correctly.
Changelog:
[Internal] [Changed] -
Reviewed By: mdvacca
Differential Revision: D79094323
fbshipit-source-id: 34967b42dc92338724dd20fb7f70a68734f6db28
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52891
Right now these are tightly coupled for no reason. The device helper just asks the root view to send the event out, which it uses ReactContext for. We can just have that be passed in and accomplish the same task.
Changelog: [Internal]
Reviewed By: Abbondanzo, rozele
Differential Revision: D79007328
fbshipit-source-id: ef0a5ac4ec0acb52fc7c2a26010811767e3c1e67
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52809
**Context**
Experimental V2 Performance Monitor prototype, beginning by bringing the [Interaction to Next Paint (INP)](https://web.dev/articles/inp) metric to React Native.
**This diff**
Add two new feature flags:
- `fuseboxInteractionMetricsEnabled` — Will configure sending of interaction live metrics to CDP clients, independent of an active performance profiling session.
- `perfMonitorV2Enabled` — Will enable the backend + UI for the V2 Perf Monitor.
Changelog: [Internal]
Reviewed By: motiz88
Differential Revision: D78894857
fbshipit-source-id: 7605357b3cc9255d76f66bde605f9e520dda9750
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52834
changelog: [internal]
we have seen some problems with the fabric commit and believe there is a race condition in the implementation.
Here, we introduce an option to disable it.
Reviewed By: rozele
Differential Revision: D78972655
fbshipit-source-id: 99005c77dbe4dde3816b9e6a692f170cf287f7cd
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52743
We can build an accessibility tree for Talkback by overriding addChildrenForAccessibility of ViewGroup.
With this we just manually build a tree that contains the elements we care about in the order we want.
We also try to keep most of the tree intact so that coopting works properly
Changelog: [Internal]
EDITS: After backout, fixed the issue where we were incorrectly setting the `accessibility_order_parent` tag the ReactAxOrderHelper class instead of the actual view. Also, made the cast safe to prevent any unexpected issues.
Also refactored the ReactAxOrderHelper functions to not have the block scoped `traverse` functions in favor of just looping through the children of a view when calling them
Reviewed By: joevilches
Differential Revision: D78669715
fbshipit-source-id: e714367c28e722ce42895531cf18e6f2dc926556
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52791
Changelog: [internal]
This cleans up this feature flag as it doesn't work as intended. We'll try another approach with a different flag instead.
Reviewed By: sammy-SC
Differential Revision: D78815892
fbshipit-source-id: 4c651a3a225de9cfb54d00346343c7f2e3bea1d5