12634 Commits

Author SHA1 Message Date
Pieter De Baets 693e9628e8 Mark mOnViewAttachMountItems as final in SurfaceMountingManager.java (#54344)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54344

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D85904478

fbshipit-source-id: 961d12bf1cbf04b9087a518531b20d87be3ccb63
2025-10-31 15:50:52 -07:00
David Vacca 0e3a210be1 Add comprehensive KDoc documentation to FilterHelper (#54350)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54350

Added comprehensive KDoc documentation to the FilterHelper object and its primary public method for parsing and applying CSS filter effects on Android S+ (API 31+).

changelog: [internal] internal

Reviewed By: lenaic

Differential Revision: D85926889

fbshipit-source-id: e20bb0697753e710d66acc3ef4078ab009d6dc5d
2025-10-31 14:42:30 -07:00
David Vacca b8f9d982f5 Add KDoc documentation to ComponentNameResolverBinding (#54349)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54349

Added comprehensive KDoc documentation to the ComponentNameResolverBinding object and its JNI method for installing component name resolvers into the JavaScript runtime.

changelog: [internal] internal

Reviewed By: lenaic

Differential Revision: D85926888

fbshipit-source-id: 253577d4c5d48bee22acb5666680becd4e632879
2025-10-31 14:42:30 -07:00
David Vacca 7d7d843666 Add KDoc documentation to ComponentNameResolver interface (#54348)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54348

Added comprehensive KDoc documentation to the ComponentNameResolver interface and its property providing access to registered component names.

changelog: [internal] internal

Reviewed By: lenaic

Differential Revision: D85926887

fbshipit-source-id: ae12629e27f88555c7876d3343a146b1b5c3dec0
2025-10-31 14:42:30 -07:00
David Vacca 89bcc02a07 Add KDoc documentation to BlendModeHelper (#54347)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54347

Added comprehensive KDoc documentation to the BlendModeHelper object and its public method for parsing CSS mix-blend-mode properties on Android Q+.

changelog: [internal] internal

Reviewed By: lenaic

Differential Revision: D85926891

fbshipit-source-id: bcafa6b02281d5265f59b34641847bc3b19d6604
2025-10-31 14:42:30 -07:00
David Vacca ad0210c535 Add comprehensive KDoc documentation to BackgroundStyleApplicator (#54346)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54346

Added comprehensive KDoc documentation to the BackgroundStyleApplicator class and all 25 public methods covering backgrounds, borders, outlines, and box shadows.

changelog: [internal] internal

Reviewed By: lenaic

Differential Revision: D85926890

fbshipit-source-id: 5a398bf8d57d6b6dff6b012ac225bc96d56e2573
2025-10-31 14:42:30 -07:00
David Vacca cc2101d063 Add KDoc documentation to FloatUtil class (#54345)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54345

Added comprehensive KDoc documentation to the `FloatUtil` class and its public methods to improve code readability and developer experience.

The documentation explains:
- The purpose of epsilon-based floating-point comparison and why it's necessary
- The role of the EPSILON constant in determining equality
- Special case handling for NaN values (both considered equal when both are NaN)
- Null value handling in the nullable overload
- Method parameters and return values

This documentation will help developers understand the rationale behind using this utility instead of direct float equality comparisons, which can be unreliable due to floating-point precision issues.

changelog: [internal] internal

Reviewed By: lenaic

Differential Revision: D85923748

fbshipit-source-id: d054099de3d9903801aadca4cfcd3127bb6d5297
2025-10-31 14:42:30 -07:00
Gianni Moschini e2b62bc435 fix code snippet text container in AnsiHiglight (#54360)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54360

## Changelog:

[General] [Fixed] - Fixing an issue with the error LogBox formatting on windows causing text to wrap

Reviewed By: rickhanlonii, yannickl

Differential Revision: D76845667

fbshipit-source-id: 4b1ce705396f9818cbe9be80d521478b5eba632b
2025-10-31 13:24:51 -07:00
Luna Wei 025e0e47ef Remove clipping check on scrollview (#54357)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54357

Changelog: [Internal] - Ignore whether ScrollView enables subview clipping and just use the drawing rect for forwarding a clippingRect for VirtualView

Reviewed By: yungsters

Differential Revision: D85817030

fbshipit-source-id: e89298d106ec993ce1ca63131da002e0685c34dd
2025-10-31 13:23:26 -07:00
Rubén Norte 15589485c5 Remove legacy profiling for network requests (#54353)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54353

Changelog: [internal]

We have support for the network track in performance traces so we no longer need this custom integration.

Reviewed By: huntie

Differential Revision: D85946500

fbshipit-source-id: 4efa132a6524af6595ddf9f8c2b5651959fa1f94
2025-10-31 11:11:33 -07:00
Rubén Norte ad5ff285a9 Unify perf tracks under a React Native track group (#54354)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54354

Changelog: [internal]

This just renames the tracks for network, etc. to go under a "⚛ Native" track group.

Reviewed By: huntie

Differential Revision: D85946501

fbshipit-source-id: f7ea65bfd84ed4965749f7e22091bcaff38a5bc3
2025-10-31 11:11:33 -07:00
Rubén Norte 3806edc1bd Use try/finally for performance measure for device events (#54355)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54355

Changelog: [internal]

Small refactor to make sure profiling timespans don't break if there's an exception in one of the listeners.

Reviewed By: huntie

Differential Revision: D85951560

fbshipit-source-id: 162672a7e644893f46a3b0100284bc4125a83757
2025-10-31 11:11:33 -07:00
nishan (o^▽^o) 20ba98e00d feat(iOS) - Add contrast and hue rotate filter (#54294)
Summary:
This PR adds support for `contrast` and `hueRotate` filter support on iOS as discussed here - https://github.com/react-native-community/discussions-and-proposals/issues/927

## Changelog:

[IOS] [ADDED] - Add contrast and hue-rotate CSS filters

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/54294

Test Plan:
Test Filter screen in RNTester app. Checkout contrast and hue-rotate examples. Results are consistent on android and iOS.

<img width="300" height="auto" alt="Screenshot 2025-10-28 at 6 43 10 AM" src="https://github.com/user-attachments/assets/da7e4166-5723-4e4d-8d94-df9efb127672" />

<img width="300" height="auto" alt="Screenshot 2025-10-28 at 6 02 40 AM" src="https://github.com/user-attachments/assets/2d332202-6b2e-4269-93ed-3f80d3e03e4a" />

cc - joevilches thanks! remaining filters are `invert` and `sepia`. These are a bit tricky as they don't have direct SwiftUI equivalents. I am trying a few things, will do a PR when I get it working.

Reviewed By: jorge-cab

Differential Revision: D85961419

Pulled By: joevilches

fbshipit-source-id: f4628b17570e5b8fd3092392224f2d84b7d47d1d
2025-10-31 11:09:37 -07:00
Alex Hunt a74387be66 Add Performance Issues to Perf Monitor (2/2) (#54266)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54266

Introduces the concept of **Performance Issues**, an experimental performance signals concept for React Native.

**Design**

Performance Issues are an **experimental** user space API via the User Timings `detail` object.

```
performance.measure({
  start,
  end,
  detail: {
    devtools: {
      ...
    },
   rnPerfIssue: {
     name: 'React: Cascading Update',
     severity: 'warning', // 'info' | 'warning' | 'error',
     description:
      'A cascading update is a update that is triggered by a previous update. This can lead to performance issues and should be avoided.',
    learnMoreUrl:
      'https://react.dev/reference/dev-tools/react-performance-tracks#cascading-updates',
    }
  }
});
```

When `rnPerfIssue` is present, we eagerly report an the event over CDP, regardless of an active performance trace, via the `"__react_native_perf_issues_reporter"` runtime binding.

**This diff**

- Updates the V2 Perf Monitor UI (Android) to display Performance Issues as a count.
    - (UI parts of this diff, including `HostTarget::installPerfIssuesBinding` are reinstated from the previous INP design, removed in D82208400).

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D85448199

fbshipit-source-id: 0cee0eff275219fa46ccf788a6208889d3a0506e
2025-10-31 09:39:10 -07:00
Alex Hunt ee9ef3bf2d Add Performance Issues to Perf Monitor (1/2) (#54265)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54265

Introduces the concept of **Performance Issues**, an experimental performance signals concept for React Native.

**Design**

Performance Issues are an **experimental** user space API via the User Timings `detail` object.

```
performance.measure({
  start,
  end,
  detail: {
    devtools: {
      ...
    },
   rnPerfIssue: {
     name: 'React: Cascading Update',
     severity: 'warning', // 'info' | 'warning' | 'error',
     description:
      'A cascading update is a update that is triggered by a previous update. This can lead to performance issues and should be avoided.',
    learnMoreUrl:
      'https://react.dev/reference/dev-tools/react-performance-tracks#cascading-updates',
    }
  }
});
```

When `rnPerfIssue` is present, we eagerly report an the event over CDP, regardless of an active performance trace, via the `"__react_native_perf_issues_reporter"` runtime binding.

**This diff**

- Adds a `perfIssuesEnabled` feature flag.
- Initial implementation of the above API.
- Initially reports a "Cascading Render" issue, aligning 1:1 with the corresponding React performance track event (note: to be added in the React codebase, see https://github.com/facebook/react/pull/34961).

This feature is gated by the `perfMonitorV2Enabled` feature flag.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D85448200

fbshipit-source-id: e5aed5138682331e1cd3a713a5f09fb6745138bc
2025-10-31 09:39:10 -07:00
Alex Hunt 6d68cdf5c3 Fix missing jsi dependency following #54262 (#54341)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54341

Changelog: [Internal]

{F1983141005}

Reviewed By: cipolleschi

Differential Revision: D85888301

fbshipit-source-id: 54cfaf2995bf0231e661fc11e115266578e1f692
2025-10-31 05:57:29 -07:00
Pieter De Baets 6757e547c5 Mark private static fields as final in ReactHorizontalScrollView (#54343)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54343

Fixed NotWrittenPrivateField lint warnings in ReactHorizontalScrollView.java by marking three private static fields as final:

- DEBUG_MODE: Changed from `private static boolean` to `private static final boolean`
- TAG: Changed from `private static String` to `private static final String`
- NO_SCROLL_POSITION: Changed from `private static int` to `private static final int`

These fields are initialized once and never modified, making them compile-time constants. Marking them as final follows Java best practices and prevents potential issues with Redex code optimization.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D85904890

fbshipit-source-id: f83a19392a2418d8415936421f1e021316643056
2025-10-31 04:23:26 -07:00
Nolan O'Brien 3ff4ab2290 Fix missing enum values in switch statements (#54342)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54342

`-Wswitch-enum` was introduced in 2024 and is beneficial because it will err when switch statement is missing a case for an enum, even with `default:` present.  This helps alert developers when they add an enum value of all the switch statements that need updating.

These diffs are to help progress the codebase so that we can enable `-Wswitch-enum` by default in `fbobjc`

## Changelog:
[General] [Fixed] - Add missing value to switch for `-Wswitch-enum` builds

Differential Revision: D85835952

fbshipit-source-id: e56c45895a63325e565315a39ea59df769c4a3ad
2025-10-30 21:01:45 -07:00
Vladimir Makaev ae4d79d279 Daily arc lint --take CLANGFORMAT
Reviewed By: ionutluzinschi

Differential Revision: D85728900

fbshipit-source-id: 022ac989ce5519b5b065a9fa8a20ce6438309b4c
2025-10-30 15:56:46 -07:00
Alex Hunt 7403e85233 Update debugger-frontend from 96e6bb8...7aa57d1 (#54340)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54340

Changelog: [Internal] - Update `react-native/debugger-frontend` from 96e6bb8...7aa57d1

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebook/react-native-devtools-frontend/compare/96e6bb8ecdff166816e2a469b7594f1276bda8c1...7aa57d13e50ce9d74a91c9315c9b0ded00fbc19f).

### Changelog

| Commit | Author | Date/Time | Subject |
| ------ | ------ | --------- | ------- |
| [7aa57d13e](https://github.com/facebook/react-native-devtools-frontend/commit/7aa57d13e) | Alex Hunt (hello@alexhunt.dev) | 2025-10-30T19:45:26+00:00 | [Add AGENTS.md (#215)](https://github.com/facebook/react-native-devtools-frontend/commit/7aa57d13e) |
| [d524f81db](https://github.com/facebook/react-native-devtools-frontend/commit/d524f81db) | Alex Hunt (hello@alexhunt.dev) | 2025-10-30T18:43:44+00:00 | [Enable Performance panel by default (#216)](https://github.com/facebook/react-native-devtools-frontend/commit/d524f81db) |
| [62f76dfbb](https://github.com/facebook/react-native-devtools-frontend/commit/62f76dfbb) | Alex Hunt (hello@alexhunt.dev) | 2025-10-30T17:01:50+00:00 | [Update project name in setup script (#214)](https://github.com/facebook/react-native-devtools-frontend/commit/62f76dfbb) |

Reviewed By: hoxyq

Differential Revision: D85888511

fbshipit-source-id: fbe4be107d8be6db7b91199dfe44b604b5be0036
2025-10-30 13:31:38 -07:00
Eric Rozell 600a8dc1da Allow customization of requestChildFocus scroll behavior in ScrollView (#54325)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54325

Apps that override ScrollView may need to customize the auto scroll behavior on focus.  This adds a protected method for apps that override ReactScrollView to customize focus behaviors.

## Changelog
[Internal]

Reviewed By: joevilches

Differential Revision: D85779339

fbshipit-source-id: 1ba978ed14ceb224ddc1d0da97727ff9702972e7
2025-10-30 12:22:50 -07:00
Alex Hunt 9693a2b855 Support parsing of detail arg from console.timeStamp (#54262)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54262

Similar to `performance.measure()`, Chrome is adding an optional `detail` arg to `console.timeStamp`. Here we implement this for React Native, by direct passing to the `"TimeStamp"` trace event args.

[`console.timeStamp()`](https://developer.mozilla.org/en-US/docs/Web/API/console/timeStamp_static) remains an experimental, non-standard API.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D85437162

fbshipit-source-id: 36f5f6207cf205df5a216bde95013ea9540fc082
2025-10-30 11:42:24 -07:00
Rubén Norte e8fcde50e3 Simplify module after DOM API feature flag cleanup (#54323)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54323

Changelog: [internal]

We no longer need to lazily load these modules, because they're always used now.

Reviewed By: lunaleaps

Differential Revision: D85782126

fbshipit-source-id: 263eb234558b90d9cf5c6d55bccb39eb8d1c6a48
2025-10-30 08:37:04 -07:00
Rubén Norte 234b53d0f8 Merge tests for legacy node methods into ReactNativeElement test (#54321)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54321

Changelog: [internal]

Just moving some tests from `ReactFabricPublicInstance` to `ReactNativeElement` now that they're only used for that class.

Reviewed By: lunaleaps

Differential Revision: D85782130

fbshipit-source-id: 1445f61df2cbd691e09187b3b122032ad941cd67
2025-10-30 08:37:04 -07:00
Rubén Norte 8217165442 Delete unused legacy ReactFabricHostComponent class (#54320)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54320

Changelog: [internal]

This class is no longer used after we shipped DOM APIs.

Reviewed By: lunaleaps

Differential Revision: D85782129

fbshipit-source-id: 7ffa33aa1bade777d2b3fb7ae8b7c136376983a7
2025-10-30 08:37:04 -07:00
Rubén Norte 9c4601abec Clean up feature flag "enableAccessToHostTreeInFabric" (#54322)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54322

Changelog: [internal]

This just cleans up the feature flag, which is set to `true` by default and it's been enabled in `stable` already.

Reviewed By: lunaleaps, yungsters

Differential Revision: D85782127

fbshipit-source-id: 0a6174708066cfe597b4c6dbc8bb33829c6155e9
2025-10-30 08:37:04 -07:00
Rubén Norte beccee2164 Promote Web Performance APIs to stable (#54324)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54324

Changelog: [General][Added] - Enable Web Performance APIs

This promotes the Web Performance APIs from canary to stable.

Reviewed By: cipolleschi

Differential Revision: D85783108

fbshipit-source-id: 8d8b4565f28dc20d63e677c01366f4f37d5c46e4
2025-10-30 08:34:57 -07:00
Samuel Susla 71f5c744db add name of command for systrace for easier debugging (#54328)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54328

changelog: [internal]

makes debugging easier if there is name of command.

Reviewed By: christophpurrer, javache

Differential Revision: D85784113

fbshipit-source-id: 14f89ea8b8401dce2dc84d14caaecc6cacda04b2
2025-10-30 06:04:42 -07:00
Harini Malothu f9754d3459 Ccomparison between signed and unsigned values, causing a error (#54318)
Summary:
We saw this error while integrating  changes in react native windows
https://github.com/microsoft/react-native-windows/issues/15292
Fixed type consistency in cloneMultipleRecursive by using size_t for loop iterator to properly match vector size type, improving type safety when iterating over children nodes.

## Changelog:
[GENERAL][FIXED] - Use size_t instead of int for vector iteration in cloneMultipleRecursive
<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

|GENERAL|FIXED|- Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/54318

Reviewed By: christophpurrer

Differential Revision: D85800905

Pulled By: javache

fbshipit-source-id: 2fdb539e1c9af56eebdd5c7a900fa0e697bcab3a
2025-10-30 03:52:14 -07:00
Jorge Cabiedes Acosta d0015e0838 Fix visual artifacts when sometimes using decimal assymetric borderRadii (#54237)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54237

Before we were adding a single pixel for the stretchable area. in RCTViewComponentView we calculate what percentage is 1 pixel from the entire image to create the unit rectangle:
```
    CGRect contentsCenter = CGRect{
        CGPoint{imageCapInsets.left / imageSize.width, imageCapInsets.top / imageSize.height},
        CGSize{(CGFloat)1.0 / imageSize.width, (CGFloat)1.0 / imageSize.height}};
```

However sometimes when dividing `1.0 / imageSize.width` we would get a big enough float that causes a rounding error essentially having part of the border bleed into the stretchable region.

The easiest way to fix this is give the stretchable region a little more space so to prevent the bleeding.

We can do this by rounding the edgeInsets that give the border area its size

The alternative is some shockingly complex math to appropriately calculate the most convenient stretchable area size

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D85260693

fbshipit-source-id: 50eaba2189f3ff524be730211f8d19023522c68a
2025-10-29 20:31:35 -07:00
Peter Abbondanzo 26ad9492b3 Implement resizeMethod="resize" for image prefetching (#54228)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54228

## Issue
When prefetching images with the `resizeMethod` prop set, there's a brief period of time where the image has not laid out and the dimensions are 0x0. Since `ImageSource.h` only considers the `type` and `uri` properties for equality, two different `ImageSource` objects would be considered equal despite having different `size`. We would continue on to prefetch the image in its fullest quality and retain that image in `ImageState`, and upon subsequent requests once we have non-zero layouts, we would bail out early in the `ImageShadowNode::updateStateIfNeeded` method since both the old image source and image request params are equal in this case.

## Fix
Rather than adding `size` to the equality check, this change adds identical logic directly from `ReactImageView` to determine if we should postpone the image request: if the image is resizable and we don't have a width or a height, postpone!

## Additional Context
I noodled with a few spots of where this should ultimately live, but this seemed like the least invasive without making some larger refactors. The other approach I considered was to instead return an optional `ImageRequest` object from `ImageManager->requestImage call` to signal that no request was ever made, and using the `ImageRequest` response as part of the equality check.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D85200818

fbshipit-source-id: 82090feb500dafa47af14220a17262d715d20a7a
2025-10-29 16:52:18 -07:00
Zeya Peng b5e209181e Fix EXC_BAD_ACCESS introduced in #54211 (#54319)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54319

## Changelog:

[Internal] [Changed] - Fix EXC_BAD_ACCESS introduced in #54211

Reviewed By: sammy-SC

Differential Revision: D85779978

fbshipit-source-id: 7b240e1484fdcc57283325febf75faedaba585cd
2025-10-29 16:33:13 -07:00
Eric Rozell 8a3cc6411e Remove unnecessary local variable in for deferred focus (#54326)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54326

This variable was not needed, isAttachedToWindow was working as expected.

## Changelog
[Internal]

Reviewed By: Abbondanzo

Differential Revision: D85798355

fbshipit-source-id: 1716b323b4ac0d1d6f3e29370223db66540020d2
2025-10-29 16:18:32 -07:00
Rubén Norte b68329f7ca Implement Kotlin API for PerformanceTracer in RNDT (#54316)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54316

Changelog: [internal]

This defines an internal class in Kotlin to access `PerformanceTracer` methods, necessary for platform-specific integrations on Android.

Reviewed By: sbuggay

Differential Revision: D85689126

fbshipit-source-id: 84cb675984b90c677c3a322b191e24cc6b58c74f
2025-10-29 15:35:35 -07:00
Rubén Norte 712c544be6 Implement method to subscribe to tracing start/stop in RNDT (#54315)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54315

Changelog: [internal]

This adds methods to `PerformanceTracer` so consumers can be notified when tracing starts/stop. This is necessary to activate features necessary for tracing that would be costly to enable all the time.

Reviewed By: sbuggay

Differential Revision: D85689124

fbshipit-source-id: 9f9f79162dcb988ac4be02a8911401ce448461a9
2025-10-29 15:35:35 -07:00
Eric Rozell 9d498f676d Defer focus until attached (#54309)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54309

We can encounter cases where something is rendered by React but not yet attached to Android at the point focus is called.

If we defer focus until the View is attached to the window, we can avoid apps needing to add annoying timeouts or other creative mechanisms to wait for native mount before calling imperative focus.

The only caveat here is that if you call imperative focus on something offscreen initially that is attached later (e.g., due to clipping), apps could encounter undesirable bugs where focus jumps at the point the previously detached view is now attached. One might also argue it's  bug prone to call focus on something that is far offscreen / you don't plan to mount onscreen immediately.

## Changelog

[Android][Fixed] Defers focus until View is attached

Reviewed By: sbuggay

Differential Revision: D85727424

fbshipit-source-id: 677834aa2d9ba2d3247d1e71b3fe0cdd9a6ec4aa
2025-10-29 11:56:02 -07:00
Peter Abbondanzo b0b434469e Add feature flag for checking if components should send key presses (#54295)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54295

Sets up a feature flag for keydown/keyup events. Split out from actual work implementing the feature to avoid having to run codegen each commit

Changelog: [Internal]

Reviewed By: alanleedev

Differential Revision: D84938062

fbshipit-source-id: b556f347720b4a651cd321996f2914a9c670c7a1
2025-10-29 09:38:32 -07:00
Pieter De Baets aec3294807 Enable k2 for all targets, remove compiler warnings (#54284)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54284

Changelog: [Internal]

Reviewed By: alanleedev

Differential Revision: D85563230

fbshipit-source-id: 6eb7c6479ad3d0f6d6249a6a320e7835dc298db6
2025-10-29 09:30:10 -07:00
Peter Abbondanzo 242728d6c1 Set sweepActiveTouchOnChildNativeGesturesAndroid default feature flag value to true (#54307)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54307

First of the remaining steps to fully rollout `sweepActiveTouchOnChildNativeGesturesAndroid`. It's already enabled by default everywhere an override is set, letting this bake for a week then going to remove

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D85700377

fbshipit-source-id: 81f5b8679e5562ba6c5dfae331052b181b5258ec
2025-10-29 08:28:49 -07:00
generatedunixname537391475639613 a7973378ba xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java (#54311)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54311

Reviewed By: javache

Differential Revision: D85546696

fbshipit-source-id: aec0b077bca68c4a9abef98ee9db41f80edb09d9
2025-10-29 04:39:18 -07:00
Tim Yung 3f971d931c Pressability: Setup Insertion Effect Experiment (#54292)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54292

Sets up a feature flag to experiment with using `useInsertionEffect` in `Pressability`, instead of `useEffect.

Using `useInsertionEffect` enables `Pressability` to behave more predictability in component trees with `<Activity mode="hidden">` because the events are scheduled more similarly to platform controls (e.g. focus and blur events will still fire even when "hidden").

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D85612742

fbshipit-source-id: c2faab25bfcf7f964521e680eb3c4132c1087ef4
2025-10-28 12:27:37 -07:00
Phil Pluckthun c0290329cd Fix outputs when iOS artifacts generator is run from Xcode script phase (#54066)
Summary:
An earlier change (0.79 and onwards, I believe?) runs the iOS artifacts code generator script in Xcode as well as from Cocoapods. This duplication runs it twice, but the second step isn't able to load the new `autolinking.json` correctly; See: https://github.com/facebook/react-native/pull/53503

This PR "double" fixes this by:
- simply passing the "real" output directory to the artifacts generator in (`script_phases.sh`) where it's called by Xcode, rather than a temporary directory
- preferring `$RCT_SCRIPT_OUTPUT_DIR` if it's set as an environment variable in the artifacts generator (which it is by `script_phases.sh`)

While this is technically redundant, future changes here make this feel like a safer option, since both conventions overlap in these two places, and the double fix may prevent a regression here in the shortterm and convey what this path is supposed to be in both places.

## Changelog:

[IOS] [FIXED] - Fix autolinking-generated react-native-config output not being used in ReactCodegen script phase due to temp output directory

Pull Request resolved: https://github.com/facebook/react-native/pull/54066

Test Plan:
- Prefer `$RCT_SCRIPT_OUTPUT_DIR` env var for finding `build/generated/autolinking/autolinking.json`
- Always use real `$RCT_SCRIPT_OUTPUT_DIR` as output in `withCodegenDiscovery` in `react_native_pods_utils/script_phases.sh` (which is called by Xcode rather than Cocoapods to invoke the artifacts generator) since the temporary output directory isn't necessary

Reviewed By: javache

Differential Revision: D85673625

Pulled By: cipolleschi

fbshipit-source-id: 9d297fb0ee24f52a0bb7c5a8f41bf770bf63b18f
2025-10-28 10:45:33 -07:00
Peter Abbondanzo 99273f4b01 Replace deprecated postOnAnimationDelayed calls (#54285)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54285

`View#postOnAnimationDelayed` has existed [since API 16](https://developer.android.com/reference/android/view/View#postOnAnimationDelayed(java.lang.Runnable,%20long)) and has been marked as deprecated in ViewCompat [since 1.13.0](https://developer.android.com/reference/androidx/core/view/ViewCompat#postOnAnimationDelayed(android.view.View,java.lang.Runnable,long)). Let's clean it up!

Changelog: [Internal]

Reviewed By: alanleedev

Differential Revision: D85569478

fbshipit-source-id: 7cedf59c9c8fe44d2cec63d7539d955a4fa597e3
2025-10-28 10:10:37 -07:00
Riccardo Cipolleschi 28101284a9 Bump eslint-plugin-react-hooks to 7.0.1 (#54303)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54303

React 19.2.0 introduces the `useEffectEvent`, which are functions that can be used inside `useEffect` but that should not be listed in the `useEffect` dependencies.

Without this bump, eslint will still tell the user to add the function declared with `useEffectEvent` into the dependency array of a useEffect.

## Changelog:
[General][Changed] - Bump eslint-plugin-react-hooks to 7.0.1

Reviewed By: huntie

Differential Revision: D85658780

fbshipit-source-id: 75860f06a2875b53de61f4f99572277d9d04839f
2025-10-28 08:01:13 -07:00
Samuel Susla a18f7a7c7b Back out "Remove UIManagerCommitHookManager 2/2" (#54302)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54302

Changelog: [Internal]

Original commit changeset: 1c7705187346

Original Phabricator Diff: D85261208

Reviewed By: javache, rubennorte

Differential Revision: D85660275

fbshipit-source-id: 19e6c44871660a53399276445bc2d3ee97cd2ac0
2025-10-28 05:22:28 -07:00
Ruslan Lesiutin afb504c11e Update debugger-frontend from 54afd87...96e6bb8 (#54287)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54287

Changelog: [Internal] - Update `react-native/debugger-frontend` from 54afd87...96e6bb8

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebook/react-native-devtools-frontend/compare/54afd8765db32a9640edef3788085b991fe4b88a...96e6bb8ecdff166816e2a469b7594f1276bda8c1).

### Changelog

| Commit | Author | Date/Time | Subject |
| ------ | ------ | --------- | ------- |
| [96e6bb8ec](https://github.com/facebook/react-native-devtools-frontend/commit/96e6bb8ec) | Ruslan Lesiutin (28902667+hoxyq@users.noreply.github.com) | 2025-10-27T14:51:39Z | [feat: use scoped field in trace events to propagate stack traces (#213)](https://github.com/facebook/react-native-devtools-frontend/commit/96e6bb8ec) |

Reviewed By: huntie

Differential Revision: D85579573

fbshipit-source-id: b35d40a79890356761bfdfaeb7ba5c2bc19b93a5
2025-10-28 05:11:21 -07:00
Christoph Purrer e81626e34e Expose MultiPostProcessor for testing (#54296)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54296

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D85624761

fbshipit-source-id: 3adf5edafe7ed8bf416048a347a1fd9e60bfea2a
2025-10-28 00:55:00 -07:00
Nolan O'Brien 916e53f845 Fix implicit fallthrough in switch statements (#54290)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54290

A few places where we fall through intentionally are implicit.  We can make those explicit with `NS_FALLTHROUGH`.  Many places, however, are bugs from failing to add a `break` :eek: -- fix those places too.

These are all found via `-Wimplicit-fallthrough`... we will seek to make this an error by default (vs only in `CompilerWarningLevel.MEDIUM` or higher).

## Changelog:
[iOS] [Fixed] - Add missing `break;` to `-[RCTViewManager pointerEvents]`

Reviewed By: philIip

Differential Revision: D85583441

fbshipit-source-id: e8959b27a2e23ccfc6581286257d5d41b18c5630
2025-10-27 19:35:58 -07:00
Eric Rozell 363d297260 Mitigate int overflow in findNextFocusableElement (#54291)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54291

We are computing a weighted distance by squaring the major and minor axis distance. For particularly long lists, this means that items that are quite far away have a tendency to overflow the int value when squared, producing a negative number that becomes the smallest weighted distance.

Switching the computed value to double should mitigate the issue, since MAX_DOUBLE >>> MAX_INT ^ 2.

## Changelog

[Android][Fixed] - Resolves an int overflow in findNextFocusableElement

Reviewed By: martinbooth

Differential Revision: D85598005

fbshipit-source-id: 2a5de4e10c21f3d42ae5872d311e714b3f92efad
2025-10-27 19:04:38 -07:00
Christoph Purrer d9019a0b27 Remove UIManagerCommitHookManager 2/2 (#54235)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54235

Changelog: [Internal]

Reverting `experimental_prefetchResources` back to `experimental_prefetchResource` for simplicity of use

Reviewed By: lenaic, mdvacca

Differential Revision: D85261208

fbshipit-source-id: 1c7705187346a2422dddb5c106fd372a8ee49283
2025-10-27 18:40:58 -07:00