Commit Graph
1597 Commits
Author SHA1 Message Date
Panos VekrisandFacebook GitHub Bot 50ca7e5730 manual annotations in preparation of natural inference rollout in react-native, tools, etc.
Summary:
The Flow team is improving the way Flow infers type for primitive literals. This diff prepares the codebase for the new behavior by adding type annotations, or annotations of the form `'abc' as const`.

Changelog: [internal]

Reviewed By: marcoww6

Differential Revision: D75188179

fbshipit-source-id: be50990f23f79cf2d8dae7576af5190218adcafe
2025-05-21 20:06:46 -07:00
Panos VekrisandFacebook GitHub Bot 1eebb5aa11 Back out "add 'as const' annotations in preparation of natural inference rollout in xplat/js [4/n]"
Summary:
Original commit changeset: 67ee5673816d

Original Phabricator Diff: D75114154

Reviewed By: SamChou19815

Differential Revision: D75161840

fbshipit-source-id: 144fc0e488154b957f4f2a549c077a2784124849
2025-05-21 12:03:51 -07:00
Panos VekrisandFacebook GitHub Bot 2a068c6559 add 'as const' annotations in preparation of natural inference rollout in xplat/js [4/n] (#51488)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51488

The Flow team is improving the way Flow infers type for primitive literals.
Announcement: https://fb.workplace.com/groups/flowlang/permalink/1725180268087629/

This diff prepares the codebase for the new behavior by codemoding `as const` annotations.

## Repro steps

1/ Used steps in D73610163 to produce the code changes.

2/ Reverted files where `flow` errored:
```
flow status --show-all-errors > errors.log
node ~/fbsource/fbcode/flow/facebook/error-analyzer.js errors.log |
  awk -F':' '{ print $1 }' | sort -u | grep -v 'Total Error Count' |
  xargs hg revert --rev .
```

3/ Reverted files that did not improve error count in new Flow mode
```
# Run Flow before change
~/fbsource/fbcode/flow/facebook/flowd status --show-all-errors > errors-0.log
# Run Flow after change
~/fbsource/fbcode/flow/facebook/flowd status --show-all-errors > errors-1.log

# Compute error counts before and after
node ~/fbsource/fbcode/flow/facebook/error-analyzer.js errors-0.log | sort > errors-counts-0.log
node ~/fbsource/fbcode/flow/facebook/error-analyzer.js errors-1.log | sort > errors-counts-1.log

# Revert files with no change in error count
comm -12 errors-counts-0.log errors-counts-1.log | awk -F':' '{ print $1 }' | xargs hg revert --rev .~1
```

## Note to code owners

Due to the large number of errors involved in this rollout, adding `as const` was the most feasible large-scale automated solution. Ideally, a lot of these errors would be fixed by adding other appropriate type annotations. For example instead of annotating
```
type Shape = {type: 'circle', radius: number} | {type: 'square', side: number} | ...;
type ShapeKind = 'circle' | 'square' | 'triangle';
const circle = {
  type: "circle" as const,  // <-- annotation added here
  radius: 42,
};
shape.type as ShapeKind;
takesShape(circle);
```
a more appropriate annotation would be
```
const circle: Circle = { type: "circle"; radius: 42 };
...
```

Changelog: [Internal]

drop-conflicts

Reviewed By: SamChou19815

Differential Revision: D75114154

fbshipit-source-id: 67ee5673816da9625431e2a2466a1e0038386151
2025-05-21 08:42:30 -07:00
Mateo GuzmánandFacebook GitHub Bot 5596923189 Legacy Native Module e2e test (#51449)
Summary:
Found an issue with the legacy native module calls in old architecture (https://github.com/facebook/react-native/issues/51443) and got the idea of adding some simple e2e tests for the native modules so regressions like this can be captured moving forward.

This doesn't cover all methods, as not all of them are available for both Android and iOS, and also some of them are currently crashing, so it makes no sense to cover them all yet – but this can be used as a good starting point to increase coverage for essential APIs.

## Changelog:

[INTERNAL]  - Legacy Native Module e2e test

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

Test Plan:
```sh
cd packages/rn-tester && maestro test .maestro/legacy-native-module.yml -e APP_ID=com.facebook.react.uiapp
```

<img width="594" alt="image" src="https://github.com/user-attachments/assets/6237613d-f5dc-4d8a-9b12-0980177793eb" />

<img width="740" alt="image" src="https://github.com/user-attachments/assets/8bdef368-13ac-494c-a506-88fff01dc8d6" />

Reviewed By: cortinico

Differential Revision: D74978093

Pulled By: rshest

fbshipit-source-id: f9c7ba3ca5177eb3d3863d2b8252ac17f3d07aa0
2025-05-20 03:35:42 -07:00
Nick GerlemanandFacebook GitHub Bot 0cd6a29981 TextSharedExamples and empty text E2E test (#51464)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51464

Add a module of shared examples, like `TextInputSharedExamples`, to avoid copy/paste between these.

Modifies the empty test example a bit and adds an E2E test.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D74780847

fbshipit-source-id: 30c2830ef0b638680fe75b4bcf9f138f5c01e190
2025-05-19 18:15:39 -07:00
Tim YungandFacebook GitHub Bot 55cf1e7fd3 RN: Unbreak Rules of React in RNTesterPlatformTestEventRecorder (#51441)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51441

Refactors `RNTesterPlatformTestEventRecorder` so that it does not use `useMemo` from an instance method.

Instead, this diff changes the module to export a hook by the same name, `useRecorderTestEventHandlers`.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D74950333

fbshipit-source-id: 6cb222a6ec077abadbdc7008e822645aba3d07f6
2025-05-18 08:08:24 -07:00
Tim YungandFacebook GitHub Bot a1da4b102c RN: Fix Existing Lint Warnings (#51426)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51426

Fixes a bunch of ESLint warnings across the codebase.

The only remaining warnings are from the `lint/no-commonjs-exports` rule.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D74942686

fbshipit-source-id: 384de34c7297f7f7fcff1827c8b2e46714a5cda7
2025-05-17 17:18:55 -07:00
Tim YungandFacebook GitHub Bot 84de8a075e RN: Delete @oncall Annotations (#51416)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51416

Deletes `oncall` annotations from the `facebook/react-native` repository.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D74902524

fbshipit-source-id: 32a6a5b2ff27281792d572f151e2b094d9a79029
2025-05-17 16:18:05 -07:00
Tim YungandFacebook GitHub Bot ba092bfaba RN: Add Missing @format Annotations (#51415)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51415

Adds the `format` annotation to all files that were missing them.

Also, adds `noformat` to generated files, and removed it from files that no longer need them.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D74901034

fbshipit-source-id: 7e0b85ca8ee2de41278f3aa23cb03e9c266d9c28
2025-05-16 18:09:09 -07:00
Tim YungandFacebook GitHub Bot d78916d6ca RN: Prefer Destructured Import for cloneElement (#51410)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51410

Prefers using this as a destructured import instead of as a member expression of `React`.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D74895844

fbshipit-source-id: 67f334981a1effce051c89e3d4643232aa22b4e9
2025-05-16 16:33:18 -07:00
Tim YungandFacebook GitHub Bot 0a41b70164 RN: Prefer Destructured Import for useReducer (#51411)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51411

Prefers using this as a destructured import instead of as a member expression of `React`.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D74895840

fbshipit-source-id: 0a3d78d2871c3334b6e1b570744962a4d0168a9e
2025-05-16 16:33:18 -07:00
Tim YungandFacebook GitHub Bot 2f77e0d7fd RN: Prefer Destructured Import for useContext (#51412)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51412

Prefers using this as a destructured import instead of as a member expression of `React`.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D74895839

fbshipit-source-id: 9ab9fc8bdee6d1764ad86fa2165da32cb266174e
2025-05-16 16:33:18 -07:00
Tim YungandFacebook GitHub Bot 4c1477073f RN: Prefer Destructured Import for useMemo (#51407)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51407

Prefers using this as a destructured import instead of as a member expression of `React`.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D74894324

fbshipit-source-id: 7179f27f8ff1fb1b67745650b38d87cb2ea982b2
2025-05-16 16:33:18 -07:00
Tim YungandFacebook GitHub Bot 7d3c4c81b5 RN: Prefer Destructured Import for useCallback (#51406)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51406

Prefers using this as a destructured import instead of as a member expression of `React`.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D74894207

fbshipit-source-id: 00286b3dbaa6ce1e4d8d0f0f6c0dfef6505824c5
2025-05-16 16:33:18 -07:00
Tim YungandFacebook GitHub Bot 3e70714cff RN: Prefer Destructured Import for useEffect (#51405)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51405

Prefers using this as a destructured import instead of as a member expression of `React`.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D74894042

fbshipit-source-id: 93fbadb32e4a1225836db9d729d7bf502ebddd84
2025-05-16 16:33:18 -07:00
Tim YungandFacebook GitHub Bot 1bf167ce97 RN: Prefer Destructured Import for useRef (#51404)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51404

Prefers using this as a destructured import instead of as a member expression of `React`.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D74893440

fbshipit-source-id: 9032f1e867a34b9cfa808f920a38f2630046eed7
2025-05-16 16:33:18 -07:00
Tim YungandFacebook GitHub Bot 00108a1ac3 RN: Prefer Destructured Import for useState (#51403)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51403

Prefers using this as a destructured import instead of as a member expression of `React`.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D74891875

fbshipit-source-id: 981e85b5da84950c9e66e8d6b6496019e536711d
2025-05-16 16:33:18 -07:00
Tim YungandFacebook GitHub Bot 7af10f7a1a RN: Prefer Destructured Import for memo (#51401)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51401

Prefers using this as a destructured import instead of as a member expression of `React`.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D74889277

fbshipit-source-id: 0d42921758c5d6e108a4c82dbd52b7de89fbef00
2025-05-16 16:33:18 -07:00
Tim YungandFacebook GitHub Bot d7d10a4f0d RN: Prefer Destructured Import for createContext (#51400)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51400

Prefers using this as a destructured import instead of as a member expression of `React`.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D74888314

fbshipit-source-id: 9224c7c371471fe1fc42c8d42d4b37a4edadcacf
2025-05-16 16:33:18 -07:00
Tim YungandFacebook GitHub Bot 255c197baf RN: Prefer Destructured Import for createRef (#51399)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51399

Prefers using this as a destructured import instead of as a member expression of `React`.

Changelog:
[Internal]

Reviewed By: rubennorte

Differential Revision: D74888097

fbshipit-source-id: a22ca4b791153ff0c2f4ab34ff8e3ce5e9280e0d
2025-05-16 16:33:18 -07:00
Sam ZhouandFacebook GitHub Bot 797705c00d Make use of ref-as-prop support in examples (#51358)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51358

Make use of the React 19 feature so that we can remove the remaining `forwardRef` in react native.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D74812747

fbshipit-source-id: 7ded547ff62ca59d28abfc46a2f57466e2486acd
2025-05-15 09:55:32 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 84c5f294e5 Fix Maestro E2E Tests (#51347)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51347

The new warnings on RNTester for the imports are covering the New Architecture list item, as you can see from the video.

This prevents maestro from clicking on the list item, and therefore the test fails.

{F1977997600}

## Changelog:
[Internal] - Fix E2E Tests

Reviewed By: cortinico

Differential Revision: D74803709

fbshipit-source-id: 747af57d04c96ba9b0ee642eb70ebf84bca3a3fa
2025-05-15 08:15:26 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 8d634267f8 Add E2E test for FabricInteropLayer (#51269)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51269

This adds an E2E Tests for the fabric interop layer in RNTester, so we can make sure that we don't break the mechanism to add children after the view is rendered

## Changelog:
[Internal] - Add E2E test for FabricInteropLayer

Reviewed By: sammy-SC

Differential Revision: D74590458

fbshipit-source-id: 9483d1ac648d923a8494d6402b9b2f971b9b2547
2025-05-14 10:11:03 -07:00
Riccardo CipolleschiandFacebook GitHub Bot e9c8fee4ef Add Example for InteropLayer on RNTester (#51260)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51260

This is a preparatory change that adds an example to RNTester for the Fabric interop layer on iOS.
This example is needed to create a Jest E2E tests that will make sure that the Fabric Interop Layer can properly add views as subviews.

We discovered the bug thanks to react-native-maps.

## Changelog:
[Internal] - Add Example for the Fabric Interop Layer to RNTester iOS

Reviewed By: cortinico

Differential Revision: D74579737

fbshipit-source-id: 0c1bbb06790b01313cd98aa4b7152d8aba0cded3
2025-05-14 10:11:03 -07:00
Dawid MałeckiandFacebook GitHub Bot 4d0f2b2ca7 Align ImageStyle overflow prop type and compose function type (#51285)
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
2025-05-14 07:44:05 -07:00
Ruslan LesiutinandFacebook GitHub Bot 7430ee0b99 Define precise return types for toJs conversions, instead of generic jsi::Value (#51224)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51224

Changelog: [Internal]

We have a bunch of places where we rely on implicit conversion operators of `jsi::Value` and return some primitive type.

This doesn't work well with Bridging, because currently it doesn't take into account these implicit operator conversions: primitives won't be treated as primitivies, but rather as generic `jsi::Value`, which could be many things.

We should be explicit about return type in `toJs`, because it affects the type checking logic.

Reviewed By: javache

Differential Revision: D74478571

fbshipit-source-id: 0633159c5af3a02aafe14e2b137c133d4554a5f8
2025-05-12 12:38:58 -07:00
Alex HuntandFacebook GitHub Bot 12627f10b3 Report PerformanceResourceTiming events (#51126)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51126

NOTE: Resubmission of D73922341, fixing a dependency cycle (T223145455).

(Sparsely) wires up reporting of Network events to the Web Performance subsystem.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D74245441

fbshipit-source-id: ce8f47dfb3f5cd415f51287d7fcc6a048336018e
2025-05-07 03:49:56 -07:00
Jiawei LüandFacebook GitHub Bot d45c0419ac Revert D73922341: Report PerformanceResourceTiming events
Differential Revision:
D73922341

Original commit changeset: bcfc03c3d8a9

Original Phabricator Diff: D73922341

fbshipit-source-id: 3898ae763332b79f5a37fc91abb70be53c299655
2025-05-02 14:42:24 -07:00
Alex HuntandFacebook GitHub Bot ec38728c75 Report PerformanceResourceTiming events (#51025)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51025

(Sparsely) wires up reporting of Network events to the Web Performance subsystem.

Our plan is to report to the Web Performance APIs (lightweight timing metadata, here) for all build flavours, and report to CDP (more costly full metadata/previews) in dev/profiling builds.

**Notes**

- Introduces `PerformanceEntryReporter::unstable_reportResourceTiming` — this will become "stable" when further network events/fields are fully hydrated on Android and iOS.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D73922341

fbshipit-source-id: bcfc03c3d8a9a286ae72ba00a3313602fb2adea8
2025-05-02 08:14:40 -07:00
Alex HuntandFacebook GitHub Bot 6b304bc551 Fix missing podspec dependency in RCTNetwork (#51071)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51071

Follows D73995864.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D74062263

fbshipit-source-id: 2cb9bc30b36ecd2cd925bf5efa5ee31e9c8a92a6
2025-05-02 08:14:40 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 58a9046978 Improve cleanup script for ios (#51046)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51046

This small change improves the cleanup script for ios, which is now not deleting the workspace and that it might be keeping an outdated version of the codegen for OSS.

## Changelog:
[Internal] - Improve yarn clean-ios script

Reviewed By: cortinico

Differential Revision: D73988442

fbshipit-source-id: 6de5d6ab08812ba7fdb19b0cc955a38840d82f89
2025-05-02 04:21:12 -07:00
Nicola CortiandFacebook GitHub Bot c6685d29ad Fix RNTester SampleLegacyModule not rendering in Old Arch (#51073)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51073

Currently the SampleLegacyModule screen is not loading in OldArch for RNTester.

That's because we gate adding a `SampleLegacyModule` to the BaseReactPackage
only if NewArch is enabled.

This shouldn't be the case as we can still build RNTester in oldarch and we
should be able to visualize the SampleLegacyModule example.

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D74009245

fbshipit-source-id: 55eae3dc6063343f57261af2742e643a8e5c2b50
2025-05-02 03:59:10 -07:00
Alex HuntandFacebook GitHub Bot b731ea3d3f Internalise RNTester examples referencing unexported APIs (#51019)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51019

Follows D72228547 and D73770609.

This diff internalises (moves files from fbsource+GitHub to fbsource only) a number of RNTester examples which referenced `'react-native/src/private/'` subpaths.

In future, new components/APIs should be exported from index as `unstable_`, or added to `RNTesterListFbInternal` if they are exported from `src/fb_internal/`.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D73777092

fbshipit-source-id: d9fb0833c56f2ae580b6db62ddbbbeae774a0004
2025-05-01 09:58:30 -07:00
Nicola CortiandFacebook GitHub Bot 0abd5d63e1 Back out "Migrate ReactActivity" (#50998)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50998

I'm reverting this as this change is too disruptive for the OSS ecosystem.
It will break ALL the apps written in Kotlin and it's coming too close to the branch cut which is in less than one week.

We need to re-do this migration in a non breaking manner after the branch cut as this is highly disruptive for little benefit at this point

Changelog
[Android][Changed] - Back out "[RN][Kotlin] Migrate ReactActivity"

Original commit changeset: 936263100ca9

Original Phabricator Diff: D73507044

Reviewed By: mdvacca

Differential Revision: D73864144

fbshipit-source-id: 264921b1f1cd38301e66364de4b619807272bd27
2025-04-29 21:50:25 -07:00
Dawid MałeckiandFacebook GitHub Bot 7959a63a1a Migrate rn-tester codegen types imports to use root exported CodegenTypes namespace (#50976)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50976

This is the second part of the migration of `rn-tester` package to use root imports. In this diff the `CodegenTypes` namespace is used to define Codegen primitives.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D73780584

fbshipit-source-id: c13c2dfcfa4d023978a9463af1d2a3bf7b72476c
2025-04-29 06:06:16 -07:00
Dawid MałeckiandFacebook GitHub Bot ddcab831b1 Migrate already root exported deep imports in rn-tester. (#50958)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50958

In rn-tester package there are many react-native deep imports which will be deprecated in the future. It is a starter for migrating rn-tester to using root imports instead. Only deep imports that are already root exported are changed. This diff avoids using `CodegenTypes` as it causes build errors and will be resolved in next stages.

Besides import changes, `PointerEvent` type is now also exported from the root.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D73656526

fbshipit-source-id: 5814a3d9c6a04b1236581dbbe291cd109e2c71c0
2025-04-28 07:24:46 -07:00
Alex HuntandFacebook GitHub Bot 3cf0102007 Redesign New App Screen and move to package (#50939)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50939

Redesigns React Native's `NewAppScreen` component, and moves it into a new `react-native/new-app-screen` package with a single component export. Deletes the old New App Screen under `'react-native/Libraries/NewAppScreen/'`.

{F1977434404}

**Motivation**

- **Reduces our public API** (see https://github.com/react-native-community/discussions-and-proposals/pull/894)
    - Separates this screen from the main `react-native` package, where it was a number of subpath exports.
    - Reduces the size of the main `react-native` package, including image assets — which are redundant for consumers like Expo.
- **Updated visual treatment**
    - Replace outdated logo, update to a responsive tablet/windowed layout.
    - Removes outdated guidance (e.g. "use cmd+R to reload"), and generally simplifies the layout (with the aim of reducing future maintenance).
- **Simplifies template boilerplate**
    - `NewAppScreen` is now a fully encapsulated screen layout, avoiding the cruft of the previous modular design.

**Integration plan**

When we cut the `0.80-stable` branch, we'll update [the template](https://github.com/react-native-community/template/blob/main/template/App.tsx) to import and use `<NewAppScreen />`.

- This will cause an extra runtime dependency in the template `package.json`, which will require user cleanup. We are happy with this tradeoff, given the self-evident package name, reduction of template boilerplate, and size reduction on the main `react-native` package.

Changelog:
[General][Breaking] - The `NewAppScreen` component is redesigned and moved to the `react-native/new-app-screen` package

Reviewed By: cipolleschi

Differential Revision: D73657878

fbshipit-source-id: 9ca07afa9fbdd6f32015eafa2f27d52ed182918e
2025-04-28 04:17:21 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 403feb9bc2 Migrate ReactActivity (#50871)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50871

# Changelog:
[Android][Changed] - ReactActivity has been migrated to Kotlin.

Reviewed By: cortinico

Differential Revision: D73507044

fbshipit-source-id: 936263100ca93dafd643a53e5cb799fd5ed7e584
2025-04-28 01:53:11 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 6520db2868 Fix RNTester running in the old architecture (#50940)
Summary:
We landed a PR that was importing a file available only in the New Architecture also when the app was running in the old architecture.
This was creating a corrupted bundle for rntester.

This PR fixes the issue

bypass-github-export-checks

## Changelog:
[Internal] - Fix RNTester on Android

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

Test Plan: Tested locally by setting `newArchEnabled` to false in the gradle.properties file

Reviewed By: javache, cortinico

Differential Revision: D73663049

Pulled By: cipolleschi

fbshipit-source-id: c8d6e4190adee7388e51901360a811b0007ee3a5
2025-04-25 09:53:38 -07:00
Nicola CortiandFacebook GitHub Bot 1c920d305d RNTester - Do not explicitely enable legacyWarningsEnabled (#50930)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50930

Due to D73591315, we don't need to specify the `legacyWarningsEnabled` for RNTester anymore as it's effectively ignored.

Changelog:
[Internal] [Changed] -

Reviewed By: rshest, cipolleschi

Differential Revision: D73654270

fbshipit-source-id: 9428634fb8374024940e4041de60d679b6f352a2
2025-04-25 07:49:59 -07:00
Jorge Cabiedes AcostaandFacebook GitHub Bot fcb3ef3f76 Add unit tests for Radial Gradient and fix typo on conversion.h (#50835)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50835

tsia

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D73371776

fbshipit-source-id: 0016f42de4dc95d76da561f6af9c7ef57e407a2c
2025-04-24 17:27:52 -07:00
AjitandFacebook GitHub Bot 87c54a7eba fix fetch of content scheme urls failing on Android (#50122)
Summary:
This PR fixes https://github.com/facebook/react-native/issues/48762
- fix creating Blobs from Android 'content://' scheme urls was failing on the js side due to [this check](https://github.com/JakeChampion/fetch/blob/ba5cf1ed2e02ebb96fa1e60b4fd2eb04071b60e4/fetch.js#L547)

## Changelog:
[ANDROID] [FIXED] - fix fetch of content scheme uris failing on Android.

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

Test Plan:
Used the App here to test Android Blob creation. https://github.com/giantslogik/blob-large-file-fetch.

EDIT: Added tester to RNTester

Reviewed By: rshest

Differential Revision: D73576300

Pulled By: javache

fbshipit-source-id: 3fa5966aabd10d5fbe9f441948309c66e7113199
2025-04-24 12:39:58 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 0e11e6a28b Sync React 19.1 into React Native OSS (#50865)
Summary:
X-link: https://github.com/facebook/metro/pull/1492

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

This change updates React in React Native OSS from 19 to 19.1
bypass-github-export-checks
## Changelog:
[General][Changed] - Bump React to 19.1

## Internal:
jest_e2e[run_all_tests]

Reviewed By: cortinico

Differential Revision: D73502629

fbshipit-source-id: 362897e8b491d1474f433ee7ad3306baf95d2e6c
2025-04-24 10:15:42 -07:00
Zeya PengandFacebook GitHub Bot 5ec00097b6 Add pan gesture animation examples to rntester (#50851)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50851

## Changelog:

[General] [Added] - Add pan gesture animation example to rntester

Including examples of
* using native driven Animated.event + touch event (which will not be interrupted by busy js thread, and is potentially a boost to performance) - the code requires some hacks but it's doable
* using js PanResponder to drive pan gesture animation

Reviewed By: sammy-SC

Differential Revision: D68909931

fbshipit-source-id: 484ecb0646fb249b31362013725219a1c1ec6181
2025-04-23 16:41:46 -07:00
Peter AbbondanzoandFacebook GitHub Bot 93f12eb71d Add prop to filter drag and drop pasting on iOS (#50533)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50533

Builds upon https://github.com/facebook/react-native/pull/49446

On iOS, by default, every EditText accepts DragEvent and will automatically focus themselves to accept these data. In some rare cases, it might not be desirable to allow data from arbitrary drag and drop events to be pasted into a text input.

This change adds a new prop `acceptDragAndDropTypes` to do exactly that: reject drag and drop events by telling the system to ignore certain types of drag data and, by proxy, disabling behavior that automatically focuses the text input.

The prop accepts a list of [Uniform Type Identifiers](https://developer.apple.com/documentation/uniformtypeidentifiers) that iOS supports. It's important to note that these are *not* MIME types. A MIME type would be something like `text/plain` but the equivalent for iOS is `public.plain-text`.

It's important to note that this is an experimental prop, as is evident by the `experimental_` prefix on the JS side. Its signature could change before the prop has fully matured, use at your own risk

Changelog: [iOS][Added] - Add new prop for filtering drag and drop targeting to text inputs

Reviewed By: javache

Differential Revision: D70992749

fbshipit-source-id: 22b5aa1b4ced14147bf16a844361acf6f99c5a40
2025-04-23 13:13:17 -07:00
Peter AbbondanzoandFacebook GitHub Bot d10dd7130c Add prop to filter drag and drop pasting on Android (#49446)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49446

On Android, by default, every EditText accepts `DragEvent` and will automatically focus themselves to accept these data. In some rare cases, it might not be desirable to allow data from arbitrary drag and drop events to be pasted into a text input.

This change adds a new prop `acceptDragAndDropTypes`  to do exactly that: reject drag and drop events by telling the system to ignore certain types of drag data and, by proxy, disabling behavior that automatically focuses the text input.

The prop accepts a subset of MIME types supported by Android as documented [here](https://developer.android.com/reference/android/content/ClipDescription#MIMETYPE_TEXT_HTML).

It's important to note that this is an experimental prop, as is evident by the `experimental_` prefix on the JS side. Its signature could change before the prop has fully matured, use at your own risk

Changelog: [Android][Added] - Add new prop for filtering drag and drop targeting to text inputs

Reviewed By: javache

Differential Revision: D69674225

fbshipit-source-id: 4dbbdd81bb0f394b6206da5a377c75ea71671626
2025-04-23 13:13:17 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 3f41fe2948 Make fmt and SocketRocket compatible with Swift (#50874)
Summary:
`SocketRocket` and `fmt` are part of React Native dependencies.
If a library is written in swift and depends on them, it will fail to install the pods because these pods are not compatible with Swift.

This change makes sure that the pods are installed in a way that is swift compatible.

## Changelog:
[iOS][Fixed] - Make fmt and SocketRocket Swift friendly

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

Test Plan:
Tested locally in a nightly app.

### Before the change:

```
yarn add react-native-video
cd ios
bundle exec pod install
```

This script resulted in this error:

```
[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod `react-native-video` depends upon `fmt` and `SocketRocket`, which do not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.
```

### After the change

```
yarn add react-native-video
cd ios
bundle exec pod install
```

This script installed pods successfully.

Reviewed By: cortinico

Differential Revision: D73512109

Pulled By: cipolleschi

fbshipit-source-id: 222d85dba1cbdf4044e3c8459008a4083a720016
2025-04-23 12:07:20 -07:00
Iwo PlazaandFacebook GitHub Bot dc494bb341 Revert [RN][JS Stable API] Limit @react-native/virtualized-lists subpath imports (#50846)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50846

## Motivation
After a more rigorous search through GitHub uses of the restricted APIs, and consultation with framework authors, it became apparent that this restriction should be lifted.

Changelog: [Internal]

Reviewed By: zeyap

Differential Revision: D73267844

fbshipit-source-id: e6c0c146690c07debf74c51f82171a9239be5c15
2025-04-23 10:20:06 -07:00
Joe VilchesandFacebook GitHub Bot f466e43a15 Label coopting RN Tester example (#50812)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50812

tsia, adding some accessibility examples that we have refined so far this half.
Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D73283176

fbshipit-source-id: 5bb451c1e79cd8bc92f333ef2fce82669ad0e971
2025-04-21 19:16:23 -07:00
Joe VilchesandFacebook GitHub Bot e9a0747a8f Text with links RN Tester example (#50811)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50811

tsia, adding some accessibility examples that we have refined so far this half.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D73281713

fbshipit-source-id: 42db49feba5c232e699afe01916425ddf11f4aea
2025-04-21 19:16:23 -07:00