diff --git a/change/@office-iss-react-native-win32-a9e23f9c-3200-4e7b-a927-c1524d5f3be2.json b/change/@office-iss-react-native-win32-a9e23f9c-3200-4e7b-a927-c1524d5f3be2.json new file mode 100644 index 00000000000..10992742cf9 --- /dev/null +++ b/change/@office-iss-react-native-win32-a9e23f9c-3200-4e7b-a927-c1524d5f3be2.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Integrate RN 0.85.0-nightly-20260128-36f07a1b2", + "packageName": "@office-iss/react-native-win32", + "email": "email not defined", + "dependentChangeType": "patch" +} diff --git a/change/@react-native-windows-automation-channel-de51f219-371f-459d-9dd7-365fb91cfbc0.json b/change/@react-native-windows-automation-channel-de51f219-371f-459d-9dd7-365fb91cfbc0.json new file mode 100644 index 00000000000..f7f096d84f0 --- /dev/null +++ b/change/@react-native-windows-automation-channel-de51f219-371f-459d-9dd7-365fb91cfbc0.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Integrate RN 0.85.0-nightly-20260128-36f07a1b2", + "packageName": "@react-native-windows/automation-channel", + "email": "email not defined", + "dependentChangeType": "patch" +} diff --git a/change/@react-native-windows-cli-b5d209e0-f9dc-4cfc-8dfa-d25841689ae1.json b/change/@react-native-windows-cli-b5d209e0-f9dc-4cfc-8dfa-d25841689ae1.json new file mode 100644 index 00000000000..6bd0ef0ec0f --- /dev/null +++ b/change/@react-native-windows-cli-b5d209e0-f9dc-4cfc-8dfa-d25841689ae1.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Integrate RN 0.85.0-nightly-20260128-36f07a1b2", + "packageName": "@react-native-windows/cli", + "email": "email not defined", + "dependentChangeType": "patch" +} diff --git a/change/@react-native-windows-perf-testing-c7b38639-cd88-4506-84a4-1c9e0367f703.json b/change/@react-native-windows-perf-testing-c7b38639-cd88-4506-84a4-1c9e0367f703.json new file mode 100644 index 00000000000..bcdff5e2d99 --- /dev/null +++ b/change/@react-native-windows-perf-testing-c7b38639-cd88-4506-84a4-1c9e0367f703.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Integrate RN 0.85.0-nightly-20260128-36f07a1b2", + "packageName": "@react-native-windows/perf-testing", + "email": "email not defined", + "dependentChangeType": "patch" +} diff --git a/change/react-native-windows-0e30cb57-509c-4f17-b53d-85afe42a7aed.json b/change/react-native-windows-0e30cb57-509c-4f17-b53d-85afe42a7aed.json new file mode 100644 index 00000000000..fe1d10dfd5f --- /dev/null +++ b/change/react-native-windows-0e30cb57-509c-4f17-b53d-85afe42a7aed.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Integrate RN 0.85.0-nightly-20260128-36f07a1b2", + "packageName": "react-native-windows", + "email": "email not defined", + "dependentChangeType": "patch" +} diff --git a/change/react-native-windows-init-45c7b878-1e1d-4199-8d6b-1f38e4c2c557.json b/change/react-native-windows-init-45c7b878-1e1d-4199-8d6b-1f38e4c2c557.json new file mode 100644 index 00000000000..8003b4455b9 --- /dev/null +++ b/change/react-native-windows-init-45c7b878-1e1d-4199-8d6b-1f38e4c2c557.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Integrate RN 0.85.0-nightly-20260128-36f07a1b2", + "packageName": "react-native-windows-init", + "email": "email not defined", + "dependentChangeType": "patch" +} diff --git a/package.json b/package.json index 8593871a5ea..0f6d48faa79 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "prettier": "^3.6.2", "prettier-plugin-hermes-parser": "0.21.1", "react": "19.2.3", - "react-native": "0.85.0-nightly-20260114-f15985f4f", + "react-native": "0.85.0-nightly-20260128-36f07a1b2", "react-native-platform-override": "0.0.0-canary.1017", "typescript": "5.0.4" }, diff --git a/packages/@office-iss/react-native-win32-tester/overrides.json b/packages/@office-iss/react-native-win32-tester/overrides.json index 4741976cf06..ef61879127c 100644 --- a/packages/@office-iss/react-native-win32-tester/overrides.json +++ b/packages/@office-iss/react-native-win32-tester/overrides.json @@ -5,7 +5,7 @@ "excludePatterns": [ "src/js/examples-win32/**" ], - "baseVersion": "0.85.0-nightly-20260114-f15985f4f", + "baseVersion": "0.85.0-nightly-20260128-36f07a1b2", "overrides": [ { "type": "patch", @@ -17,7 +17,7 @@ "type": "patch", "file": "src/js/components/RNTesterExampleFilter.win32.js", "baseFile": "packages/rn-tester/js/components/RNTesterExampleFilter.js", - "baseHash": "142194524dd3dfc8d28f2b77fb26cd819ce0236c" + "baseHash": "6766d57ee45d36991c8c2ec6ef20f6602bc924f9" }, { "type": "platform", diff --git a/packages/@office-iss/react-native-win32-tester/package.json b/packages/@office-iss/react-native-win32-tester/package.json index 05c57fdc805..a05cfc359ed 100644 --- a/packages/@office-iss/react-native-win32-tester/package.json +++ b/packages/@office-iss/react-native-win32-tester/package.json @@ -11,7 +11,7 @@ "validate-overrides": "react-native-platform-override validate" }, "dependencies": { - "@react-native/tester": "0.85.0-nightly-20260114-f15985f4f", + "@react-native/tester": "0.85.0-nightly-20260128-36f07a1b2", "@typescript-eslint/eslint-plugin": "^8.36.0", "@typescript-eslint/parser": "^8.36.0", "flow-enums-runtime": "^0.0.6" @@ -19,7 +19,7 @@ "peerDependencies": { "@office-iss/react-native-win32": "^0.0.0-canary.311", "react": "19.2.3", - "react-native": "0.85.0-nightly-20260114-f15985f4f" + "react-native": "0.85.0-nightly-20260128-36f07a1b2" }, "devDependencies": { "@office-iss/react-native-win32": "^0.0.0-canary.311", @@ -32,7 +32,7 @@ "just-scripts": "^1.3.3", "prettier": "^3.6.2", "react": "19.2.3", - "react-native": "0.85.0-nightly-20260114-f15985f4f", + "react-native": "0.85.0-nightly-20260128-36f07a1b2", "react-native-platform-override": "0.0.0-canary.1022", "typescript": "5.0.4" }, diff --git a/packages/@office-iss/react-native-win32-tester/src/js/components/RNTesterExampleFilter.win32.js b/packages/@office-iss/react-native-win32-tester/src/js/components/RNTesterExampleFilter.win32.js index 11116df5f15..5f610df10fe 100644 --- a/packages/@office-iss/react-native-win32-tester/src/js/components/RNTesterExampleFilter.win32.js +++ b/packages/@office-iss/react-native-win32-tester/src/js/components/RNTesterExampleFilter.win32.js @@ -30,7 +30,7 @@ type Props = { testID?: string, hideFilterPills?: boolean, page: 'examples_page' | 'components_page' | 'bookmarks_page', - sections: $ReadOnlyArray>, + sections: ReadonlyArray>, ... }; @@ -81,7 +81,7 @@ class RNTesterExampleFilter extends React.Component, State> { } _renderFilteredSections( - filteredSections: $ReadOnlyArray<{ + filteredSections: ReadonlyArray<{ data: Array, key: string, title: string, diff --git a/packages/@office-iss/react-native-win32/.flowconfig b/packages/@office-iss/react-native-win32/.flowconfig index a98df672e58..95612478e14 100644 --- a/packages/@office-iss/react-native-win32/.flowconfig +++ b/packages/@office-iss/react-native-win32/.flowconfig @@ -175,4 +175,4 @@ untyped-import untyped-type-import [version] -^0.296.1 +^0.298.0 diff --git a/packages/@office-iss/react-native-win32/overrides.json b/packages/@office-iss/react-native-win32/overrides.json index 3b27e2e4531..002cb289f3f 100644 --- a/packages/@office-iss/react-native-win32/overrides.json +++ b/packages/@office-iss/react-native-win32/overrides.json @@ -7,25 +7,25 @@ "**/__snapshots__/**", "src-win/rntypes/**" ], - "baseVersion": "0.85.0-nightly-20260114-f15985f4f", + "baseVersion": "0.85.0-nightly-20260128-36f07a1b2", "overrides": [ { "type": "derived", "file": ".flowconfig", "baseFile": ".flowconfig", - "baseHash": "3e63114f0431abfd021daff6285787377f3f464f" + "baseHash": "66b23b57dc30a5834c9ee619d0381828b103a341" }, { "type": "derived", "file": "src-win/index.win32.js", "baseFile": "packages/react-native/index.js", - "baseHash": "43b61164095fb1f33793316908d5f974e7c46651" + "baseHash": "9007cd545c708aefc4ab3b9fb7418a210a6e879c" }, { "type": "derived", "file": "src-win/index.win32.js.flow", "baseFile": "packages/react-native/index.js.flow", - "baseHash": "da9cb1941e2b3d395d157e64a56b71a26396f2bf" + "baseHash": "62783de689e8711d7ea287966283974956d797d5" }, { "type": "platform", @@ -47,7 +47,7 @@ "type": "derived", "file": "src-win/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js", "baseFile": "packages/react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js", - "baseHash": "c0c7037e52d48caae88cffaac7f60d4dd1c32b3e" + "baseHash": "ee6f102be5d4b456d16900499a01abd0ca1ce1ba" }, { "type": "copy", @@ -66,7 +66,7 @@ "type": "derived", "file": "src-win/Libraries/Components/Button.win32.js", "baseFile": "packages/react-native/Libraries/Components/Button.js", - "baseHash": "86868c251bb5f5f62af9562cd6513ca1d5ee172d" + "baseHash": "c3f8d0874549590ba8d2d020fd1c13d604d74be9" }, { "type": "platform", @@ -98,7 +98,7 @@ "type": "copy", "file": "src-win/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js", "baseFile": "packages/react-native/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js", - "baseHash": "85efdbe556a087175fb9328f8d6e8d1f2cf29447" + "baseHash": "5eb51a48b73b5c1ccc24fe34fd91c67c01b969d4" }, { "type": "copy", @@ -114,7 +114,7 @@ "type": "derived", "file": "src-win/Libraries/Components/TextInput/TextInput.flow.win32.js", "baseFile": "packages/react-native/Libraries/Components/TextInput/TextInput.flow.js", - "baseHash": "6ea370fcabb5bb0db9682ed28ed832d971937caa" + "baseHash": "89dae9a6774a2fd24d7468702a616752e314d727" }, { "type": "derived", @@ -147,7 +147,7 @@ "type": "patch", "file": "src-win/Libraries/Components/Touchable/Touchable.win32.js", "baseFile": "packages/react-native/Libraries/Components/Touchable/Touchable.js", - "baseHash": "c71e7df7fbdeb6b2c1e9766e95725a56643fa28d" + "baseHash": "a9e38223753e718c5410a8ca9973064e699c1ab4" }, { "type": "derived", @@ -195,7 +195,7 @@ "type": "derived", "file": "src-win/Libraries/Components/View/ViewAccessibility.win32.js", "baseFile": "packages/react-native/Libraries/Components/View/ViewAccessibility.js", - "baseHash": "a4e4e6f4bf2df4685da8fa72a0dc63aee8c4b5db" + "baseHash": "7f8b076ccf47b528c604d2b1086754c351689b2e" }, { "type": "derived", @@ -341,7 +341,7 @@ "type": "copy", "file": "src-win/Libraries/Network/RCTNetworking.win32.js", "baseFile": "packages/react-native/Libraries/Network/RCTNetworking.ios.js", - "baseHash": "6cc93d00e1b6f541d08102cdc5363184f7ed6025", + "baseHash": "475b803e357811f6989d8d116bb040cfb1735b7c", "issue": 4318 }, { @@ -400,7 +400,7 @@ "type": "patch", "file": "src-win/Libraries/Renderer/shims/ReactNativeTypes.win32.js", "baseFile": "packages/react-native/Libraries/Renderer/shims/ReactNativeTypes.js", - "baseHash": "41da351b1e8d090e5ecf0859738218a5dcd4c08f", + "baseHash": "333afc05f5a42a5321196f5f7a14d14c8fd5dd0f", "issue": 0 }, { @@ -431,7 +431,7 @@ "type": "derived", "file": "src-win/Libraries/Text/Text.win32.js", "baseFile": "packages/react-native/Libraries/Text/Text.js", - "baseHash": "74cfb0cdb33d310206989381bccd0e00a7900078" + "baseHash": "618b750401e9066b212477f3c5d5484e4d181e32" }, { "type": "derived", @@ -450,7 +450,7 @@ "type": "patch", "file": "src-win/Libraries/Types/CoreEventTypes.win32.js", "baseFile": "packages/react-native/Libraries/Types/CoreEventTypes.js", - "baseHash": "f28ed059b210c9552fde4b43521980ba02f18c33", + "baseHash": "a171d222c66e809419656decb12be33185f35952", "issue": 6240 }, { @@ -497,13 +497,13 @@ "type": "copy", "file": "src-win/Libraries/Utilities/useMergeRefs.js", "baseFile": "packages/react-native/Libraries/Utilities/useMergeRefs.js", - "baseHash": "4ab145e150c82f4f82547122896e02f45103d1a1" + "baseHash": "a4f8be3b9ee884407be60acd32755eea5490ac45" }, { "type": "patch", "file": "src-win/src/private/animated/NativeAnimatedHelper.win32.js", "baseFile": "packages/react-native/src/private/animated/NativeAnimatedHelper.js", - "baseHash": "8d8ffd25d13e27e78900e3e90a686df9e2339159", + "baseHash": "b2f5d15fcf7b7b26fbd49e0196037fbb8175bb17", "issue": 11041 }, { diff --git a/packages/@office-iss/react-native-win32/package.json b/packages/@office-iss/react-native-win32/package.json index 3d813b21aaa..ef456ccfb8e 100644 --- a/packages/@office-iss/react-native-win32/package.json +++ b/packages/@office-iss/react-native-win32/package.json @@ -30,13 +30,13 @@ "@react-native-community/cli-platform-android": "20.0.0", "@react-native-community/cli-platform-ios": "20.0.0", "@react-native/assets": "1.0.0", - "@react-native/assets-registry": "0.85.0-nightly-20260114-f15985f4f", - "@react-native/codegen": "0.85.0-nightly-20260114-f15985f4f", - "@react-native/community-cli-plugin": "0.85.0-nightly-20260114-f15985f4f", - "@react-native/gradle-plugin": "0.85.0-nightly-20260114-f15985f4f", - "@react-native/js-polyfills": "0.85.0-nightly-20260114-f15985f4f", - "@react-native/normalize-colors": "0.85.0-nightly-20260114-f15985f4f", - "@react-native/virtualized-lists": "0.85.0-nightly-20260114-f15985f4f", + "@react-native/assets-registry": "0.85.0-nightly-20260128-36f07a1b2", + "@react-native/codegen": "0.85.0-nightly-20260128-36f07a1b2", + "@react-native/community-cli-plugin": "0.85.0-nightly-20260128-36f07a1b2", + "@react-native/gradle-plugin": "0.85.0-nightly-20260128-36f07a1b2", + "@react-native/js-polyfills": "0.85.0-nightly-20260128-36f07a1b2", + "@react-native/normalize-colors": "0.85.0-nightly-20260128-36f07a1b2", + "@react-native/virtualized-lists": "0.85.0-nightly-20260128-36f07a1b2", "abort-controller": "^3.0.0", "anser": "^1.4.9", "ansi-regex": "^5.0.0", @@ -75,7 +75,7 @@ "@babel/core": "^7.25.2", "@babel/eslint-parser": "^7.25.1", "@babel/preset-env": "^7.25.3", - "@react-native/metro-config": "0.85.0-nightly-20260114-f15985f4f", + "@react-native/metro-config": "0.85.0-nightly-20260128-36f07a1b2", "@rnw-scripts/babel-react-native-config": "0.0.0", "@rnw-scripts/eslint-config": "1.2.38", "@rnw-scripts/jest-out-of-tree-snapshot-resolver": "^1.1.42", @@ -87,19 +87,19 @@ "@types/prop-types": "15.7.1", "@types/react": "^19.2.3", "eslint": "^8.19.0", - "flow-bin": "^0.296.1", + "flow-bin": "^0.298.0", "jscodeshift": "^0.14.0", "just-scripts": "^1.3.3", "prettier": "^3.6.2", "react": "19.2.3", - "react-native": "0.85.0-nightly-20260114-f15985f4f", + "react-native": "0.85.0-nightly-20260128-36f07a1b2", "react-native-platform-override": "0.0.0-canary.1022", "typescript": "5.0.4" }, "peerDependencies": { "@types/react": "^19.2.3", "react": "^19.2.3", - "react-native": "0.85.0-nightly-20260114-f15985f4f" + "react-native": "0.85.0-nightly-20260128-36f07a1b2" }, "beachball": { "defaultNpmTag": "canary", diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js index d6c48a728f9..7404dacc8a5 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js @@ -51,36 +51,34 @@ type AccessibilityEventTypes = | 'windowStateChange'; // Mapping of public event names to platform-specific event names. -const EventNames: Map< - $Keys, - string, -> = Platform.OS === 'android' - ? new Map([ - ['change', 'touchExplorationDidChange'], - ['reduceMotionChanged', 'reduceMotionDidChange'], - ['highTextContrastChanged', 'highTextContrastDidChange'], - ['screenReaderChanged', 'touchExplorationDidChange'], - ['accessibilityServiceChanged', 'accessibilityServiceDidChange'], - ['invertColorsChanged', 'invertColorDidChange'], - ['grayscaleChanged', 'grayscaleModeDidChange'], - ]) - : Platform.OS === 'win32' +const EventNames: Map = + Platform.OS === 'android' ? new Map([ - ['change', 'TOUCH_EXPLORATION_EVENT'], - ['reduceMotionChanged', 'REDUCE_MOTION_EVENT'], - ['screenReaderChanged', 'TOUCH_EXPLORATION_EVENT'], + ['change', 'touchExplorationDidChange'], + ['reduceMotionChanged', 'reduceMotionDidChange'], + ['highTextContrastChanged', 'highTextContrastDidChange'], + ['screenReaderChanged', 'touchExplorationDidChange'], + ['accessibilityServiceChanged', 'accessibilityServiceDidChange'], + ['invertColorsChanged', 'invertColorDidChange'], + ['grayscaleChanged', 'grayscaleModeDidChange'], ]) - : new Map([ - ['announcementFinished', 'announcementFinished'], - ['boldTextChanged', 'boldTextChanged'], - ['change', 'screenReaderChanged'], - ['grayscaleChanged', 'grayscaleChanged'], - ['invertColorsChanged', 'invertColorsChanged'], - ['reduceMotionChanged', 'reduceMotionChanged'], - ['reduceTransparencyChanged', 'reduceTransparencyChanged'], - ['screenReaderChanged', 'screenReaderChanged'], - ['darkerSystemColorsChanged', 'darkerSystemColorsChanged'], - ]); + : Platform.OS === 'win32' + ? new Map([ + ['change', 'TOUCH_EXPLORATION_EVENT'], + ['reduceMotionChanged', 'REDUCE_MOTION_EVENT'], + ['screenReaderChanged', 'TOUCH_EXPLORATION_EVENT'], + ]) + : new Map([ + ['announcementFinished', 'announcementFinished'], + ['boldTextChanged', 'boldTextChanged'], + ['change', 'screenReaderChanged'], + ['grayscaleChanged', 'grayscaleChanged'], + ['invertColorsChanged', 'invertColorsChanged'], + ['reduceMotionChanged', 'reduceMotionChanged'], + ['reduceTransparencyChanged', 'reduceTransparencyChanged'], + ['screenReaderChanged', 'screenReaderChanged'], + ['darkerSystemColorsChanged', 'darkerSystemColorsChanged'], + ]); /** * Sometimes it's useful to know whether or not the device has a screen reader @@ -450,7 +448,7 @@ const AccessibilityInfo = { * * See https://reactnative.dev/docs/accessibilityinfo#addeventlistener */ - addEventListener>( + addEventListener( eventName: K, // $FlowFixMe[incompatible-type] - Flow bug with unions and generics (T128099423) handler: (...AccessibilityEventDefinitions[K]) => void, diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/Button.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/Button.win32.js index 622418c8343..102868806b2 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/Button.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/Button.win32.js @@ -148,7 +148,7 @@ export type ButtonProps = Readonly<{ * Accessibility props. */ accessible?: ?boolean, - accessibilityActions?: ?$ReadOnlyArray, + accessibilityActions?: ?ReadonlyArray, onAccessibilityAction?: ?(event: AccessibilityActionEvent) => unknown, accessibilityState?: ?AccessibilityState, diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js index 7d51999f5e6..447327cb669 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js @@ -21,7 +21,7 @@ export type {ProgressBarAndroidProps}; // of ProgressBarAndroidProps. TS's Omit does not distribute over unions, so // we define our own version which does. This does not affect Flow. // $FlowExpectedError[unclear-type] -type Omit = T extends any ? Pick, K>> : T; +type Omit = T extends any ? Pick> : T; /** * ProgressBarAndroid has been extracted from react-native core and will be removed in a future release. diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/TextInput/TextInput.flow.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/TextInput/TextInput.flow.win32.js index 72028efc19a..4371c962451 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/TextInput/TextInput.flow.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/TextInput/TextInput.flow.win32.js @@ -29,6 +29,7 @@ type TextInputChangeEventData = Readonly<{ eventCount: number, target: number, text: string, + selection?: Selection, }>; export type TextInputChangeEvent = @@ -306,7 +307,7 @@ export type TextInputIOSProps = Readonly<{ */ dataDetectorTypes?: | ?DataDetectorTypesType - | $ReadOnlyArray, + | ReadonlyArray, /** * If `true`, the keyboard disables the return key when there is no text and @@ -557,7 +558,7 @@ type TextInputBaseProps = Readonly<{ * * @see https://developer.android.com/reference/android/content/ClipData for more information on MIME types */ - experimental_acceptDragAndDropTypes?: ?$ReadOnlyArray, + experimental_acceptDragAndDropTypes?: ?ReadonlyArray, /** * String to be read by screenreaders to indicate an error state. The acceptable parameters * of accessibilityErrorMessage is a string. Setting accessibilityInvalid to true activates diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/Touchable/Touchable.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/Touchable/Touchable.win32.js index 4e4b6e272f0..bc98fdafdab 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/Touchable/Touchable.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/Touchable/Touchable.win32.js @@ -25,7 +25,7 @@ import Position from './Position'; import * as React from 'react'; const extractSingleTouch = (nativeEvent: { - +changedTouches: $ReadOnlyArray, + +changedTouches: ReadonlyArray, +altKey: ?boolean, +button: ?number, +ctrlKey: ?boolean, @@ -39,7 +39,7 @@ const extractSingleTouch = (nativeEvent: { +shiftKey: ?boolean, +target: ?number, +timestamp: number, - +touches: $ReadOnlyArray, + +touches: ReadonlyArray, }) => { const touches = nativeEvent.touches; const changedTouches = nativeEvent.changedTouches; diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/ViewAccessibility.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/ViewAccessibility.win32.js index 04765d5484c..257edbc07a7 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/ViewAccessibility.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/ViewAccessibility.win32.js @@ -400,7 +400,7 @@ export type AccessibilityProps = Readonly<{ * Provides an array of custom actions available for accessibility. * */ - accessibilityActions?: ?$ReadOnlyArray, + accessibilityActions?: ?ReadonlyArray, /** * alias for accessibilityState diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Network/RCTNetworking.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Network/RCTNetworking.win32.js index 454ce4b9176..ec4720f9f46 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Network/RCTNetworking.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Network/RCTNetworking.win32.js @@ -18,7 +18,7 @@ import {type RCTNetworkingEventDefinitions} from './RCTNetworkingEventDefinition import {type NativeResponseType} from './XMLHttpRequest'; const RCTNetworking = { - addListener>( + addListener( eventType: K, listener: (...RCTNetworkingEventDefinitions[K]) => unknown, context?: unknown, diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Renderer/shims/ReactNativeTypes.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Renderer/shims/ReactNativeTypes.win32.js index 3226d4b538b..ee6ae134cac 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Renderer/shims/ReactNativeTypes.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Renderer/shims/ReactNativeTypes.win32.js @@ -7,9 +7,7 @@ * @noformat * @nolint * @flow strict - * @generated SignedSource<<989e6e2e860dc2af7ba983849111bda8>> - * - * This file was sync'd from the facebook/react repository. + * @generated SignedSource<> */ import type { diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Text/Text.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Text/Text.win32.js index 0a00d4416c1..bf9cdbf3748 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Text/Text.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Text/Text.win32.js @@ -14,7 +14,6 @@ import type {GestureResponderEvent} from '../Types/CoreEventTypes'; import type {NativeTextProps} from './TextNativeComponent'; import type {PressRetentionOffset, TextProps} from './TextProps'; -import * as ReactNativeFeatureFlags from '../../src/private/featureflags/ReactNativeFeatureFlags'; import * as PressabilityDebug from '../Pressability/PressabilityDebug'; import usePressability from '../Pressability/usePressability'; import flattenStyle from '../StyleSheet/flattenStyle'; @@ -36,747 +35,352 @@ type TextForwardRef = React.ElementRef< * * @see https://reactnative.dev/docs/text */ -let _TextImpl; -if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) { - const TextImplNoDefaultProps: component( - ref?: React.RefSetter, - ...props: TextProps - ) = ({ - ref: forwardedRef, - accessible, - accessibilityLabel, - accessibilityRole, - accessibilityState, - allowFontScaling, - 'aria-busy': ariaBusy, - 'aria-checked': ariaChecked, - 'aria-disabled': ariaDisabled, - 'aria-expanded': ariaExpanded, - 'aria-hidden': ariaHidden, - 'aria-label': ariaLabel, - 'aria-selected': ariaSelected, - // #[ Win32 - 'aria-level': ariaLevel, - 'aria-multiselectable': ariaMultiselectable, - 'aria-posinset': ariaPosinset, - 'aria-required': ariaRequired, - 'aria-setsize': ariaSetsize, - 'aria-controls': ariaControls, - 'aria-describedby': ariaDescribedBy, - 'aria-description': ariaDescription, - accessibilityLevel, - accessibilityPositionInSet, - accessibilitySetSize, - accessibilityControls, - accessibilityDescribedBy, - accessibilityDescription, - // #] Win32 - children, - ellipsizeMode, - disabled, - id, - nativeID, - numberOfLines, - onLongPress, - onPress, - onPressIn, - onPressOut, - onResponderGrant, - onResponderMove, - onResponderRelease, - onResponderTerminate, - onResponderTerminationRequest, - onStartShouldSetResponder, - pressRetentionOffset, - role, - selectable, - selectionColor, - suppressHighlighting, - style, - ...restProps - }: { - ref?: React.RefSetter, - ...TextProps, - }) => { - const processedProps = restProps as { - ...NativeTextProps, - }; - const _accessibilityLabel = ariaLabel ?? accessibilityLabel; - // #Win32 [ - const _accessibilityControls = ariaControls ?? accessibilityControls; - const _accessibilityDescribedBy = - ariaDescribedBy ?? accessibilityDescribedBy; - const _accessibilityDescription = - ariaDescription ?? accessibilityDescription; - const _accessibilityLevel = ariaLevel ?? accessibilityLevel; - const _accessibilityPositionInSet = - ariaPosinset ?? accessibilityPositionInSet; - const _accessibilitySetSize = ariaSetsize ?? accessibilitySetSize; - // ] #Win32 - - let _accessibilityState: ?TextProps['accessibilityState'] = - accessibilityState; - if ( - ariaBusy != null || - ariaChecked != null || - ariaDisabled != null || - ariaExpanded != null || - ariaSelected != null - ) { - if (_accessibilityState != null) { - _accessibilityState = { - busy: ariaBusy ?? _accessibilityState.busy, - checked: ariaChecked ?? _accessibilityState.checked, - disabled: ariaDisabled ?? _accessibilityState.disabled, - expanded: ariaExpanded ?? _accessibilityState.expanded, - // #Win32 [ - multiselectable: - ariaMultiselectable ?? accessibilityState?.multiselectable, - required: ariaRequired ?? accessibilityState?.required, - // ] #Win32 - selected: ariaSelected ?? _accessibilityState.selected, - }; - } else { - _accessibilityState = { - busy: ariaBusy, - checked: ariaChecked, - disabled: ariaDisabled, - expanded: ariaExpanded, - // #Win32 [ - multiselectable: ariaMultiselectable, - required: ariaRequired, - // ] #Win32 - selected: ariaSelected, - }; - } +const TextImpl: component( + ref?: React.RefSetter, + ...props: TextProps +) = ({ + ref: forwardedRef, + accessible, + accessibilityLabel, + accessibilityRole, + accessibilityState, + allowFontScaling, + 'aria-busy': ariaBusy, + 'aria-checked': ariaChecked, + 'aria-disabled': ariaDisabled, + 'aria-expanded': ariaExpanded, + 'aria-hidden': ariaHidden, + 'aria-label': ariaLabel, + 'aria-selected': ariaSelected, + // #[ Win32 + 'aria-level': ariaLevel, + 'aria-multiselectable': ariaMultiselectable, + 'aria-posinset': ariaPosinset, + 'aria-required': ariaRequired, + 'aria-setsize': ariaSetsize, + 'aria-controls': ariaControls, + 'aria-describedby': ariaDescribedBy, + 'aria-description': ariaDescription, + accessibilityLevel, + accessibilityPositionInSet, + accessibilitySetSize, + accessibilityControls, + accessibilityDescribedBy, + accessibilityDescription, + // #] Win32 + children, + ellipsizeMode, + disabled, + id, + nativeID, + numberOfLines, + onLongPress, + onPress, + onPressIn, + onPressOut, + onResponderGrant, + onResponderMove, + onResponderRelease, + onResponderTerminate, + onResponderTerminationRequest, + onStartShouldSetResponder, + pressRetentionOffset, + role, + selectable, + selectionColor, + suppressHighlighting, + style, + ...restProps +}: { + ref?: React.RefSetter, + ...TextProps, +}) => { + const processedProps = restProps as { + ...NativeTextProps, + }; + const _accessibilityLabel = ariaLabel ?? accessibilityLabel; + // #Win32 [ + const _accessibilityControls = ariaControls ?? accessibilityControls; + const _accessibilityDescribedBy = + ariaDescribedBy ?? accessibilityDescribedBy; + const _accessibilityDescription = + ariaDescription ?? accessibilityDescription; + const _accessibilityLevel = ariaLevel ?? accessibilityLevel; + const _accessibilityPositionInSet = + ariaPosinset ?? accessibilityPositionInSet; + const _accessibilitySetSize = ariaSetsize ?? accessibilitySetSize; + // ] #Win32 + + let _accessibilityState: ?TextProps['accessibilityState'] = + accessibilityState; + if ( + ariaBusy != null || + ariaChecked != null || + ariaDisabled != null || + ariaExpanded != null || + ariaSelected != null + ) { + if (_accessibilityState != null) { + _accessibilityState = { + busy: ariaBusy ?? _accessibilityState.busy, + checked: ariaChecked ?? _accessibilityState.checked, + disabled: ariaDisabled ?? _accessibilityState.disabled, + expanded: ariaExpanded ?? _accessibilityState.expanded, + // #Win32 [ + multiselectable: + ariaMultiselectable ?? accessibilityState?.multiselectable, + required: ariaRequired ?? accessibilityState?.required, + // ] #Win32 + selected: ariaSelected ?? _accessibilityState.selected, + }; + } else { + _accessibilityState = { + busy: ariaBusy, + checked: ariaChecked, + disabled: ariaDisabled, + expanded: ariaExpanded, + // #[ Win32 + multiselectable: ariaMultiselectable, + required: ariaRequired, + // #] Win32 + selected: ariaSelected, + }; } - - const _accessibilityStateDisabled = _accessibilityState?.disabled; - const _disabled = disabled ?? _accessibilityStateDisabled; - - // If the disabled prop and accessibilityState.disabled are out of sync but not both in - // falsy states we need to update the accessibilityState object to use the disabled prop. - if ( - _accessibilityState != null && - _disabled !== _accessibilityStateDisabled && - ((_disabled != null && _disabled !== false) || - (_accessibilityStateDisabled != null && - _accessibilityStateDisabled !== false)) - ) { + } + + const _accessibilityStateDisabled = _accessibilityState?.disabled; + const _disabled = disabled ?? _accessibilityStateDisabled; + + // If the disabled prop and accessibilityState.disabled are out of sync but not both in + // falsy states we need to update the accessibilityState object to use the disabled prop. + if ( + _disabled !== _accessibilityStateDisabled && + ((_disabled != null && _disabled !== false) || + (_accessibilityStateDisabled != null && + _accessibilityStateDisabled !== false)) + ) { + if (_accessibilityState == null) { + _accessibilityState = {disabled}; + } else { _accessibilityState.disabled = _disabled; } + } - if (ariaHidden !== undefined) { - processedProps.accessibilityElementsHidden = ariaHidden; - if (ariaHidden === true) { - processedProps.importantForAccessibility = 'no-hide-descendants'; - } - } - - const _accessible = Platform.select({ - ios: accessible !== false, - android: - accessible == null - ? onPress != null || onLongPress != null - : accessible, - default: accessible !== false, // [Windows #13996 - default value is accessible !== false] - }); - - const isPressable = - (onPress != null || - onLongPress != null || - onStartShouldSetResponder != null) && - _disabled !== true; - - const shouldUseLinkRole = - ReactNativeFeatureFlags.shouldUseLinkRoleForPressableText() && - isPressable && - accessibilityRole == null && - role == null; - - const _accessibilityRole = - accessibilityRole ?? (shouldUseLinkRole ? 'link' : undefined); - - const _role = shouldUseLinkRole ? undefined : role; - - // TODO: Move this processing to the view configuration. - const _selectionColor = - selectionColor != null ? processColor(selectionColor) : undefined; - - let _style = style; - if (__DEV__) { - if (PressabilityDebug.isEnabled() && onPress != null) { - _style = [style, {color: 'magenta'}]; - } - } - - let _numberOfLines = numberOfLines; - if (_numberOfLines != null && !(_numberOfLines >= 0)) { - if (__DEV__) { - console.error( - `'numberOfLines' in must be a non-negative number, received: ${_numberOfLines}. The value will be set to 0.`, - ); - } - _numberOfLines = 0; + if (ariaHidden !== undefined) { + processedProps.accessibilityElementsHidden = ariaHidden; + if (ariaHidden === true) { + processedProps.importantForAccessibility = 'no-hide-descendants'; } + } - let _selectable = selectable; - - let processedStyle = flattenStyle(_style); - if (processedStyle != null) { - let overrides: ?{...TextStyleInternal} = null; - if (typeof processedStyle.fontWeight === 'number') { - overrides = overrides || ({}: {...TextStyleInternal}); - overrides.fontWeight = - // $FlowFixMe[incompatible-type] - (String(processedStyle.fontWeight): TextStyleInternal['fontWeight']); - } - - if (processedStyle.userSelect != null) { - _selectable = userSelectToSelectableMap[processedStyle.userSelect]; - overrides = overrides || ({}: {...TextStyleInternal}); - overrides.userSelect = undefined; - } - - if (processedStyle.verticalAlign != null) { - overrides = overrides || ({}: {...TextStyleInternal}); - overrides.textAlignVertical = - verticalAlignToTextAlignVerticalMap[processedStyle.verticalAlign]; - overrides.verticalAlign = undefined; - } - - if (overrides != null) { - // $FlowFixMe[incompatible-type] - _style = [_style, overrides]; - } - } + const _accessible = Platform.select({ + ios: accessible !== false, + android: + accessible == null ? onPress != null || onLongPress != null : accessible, + default: accessible !== false, // [Windows #13996 - default value is accessible !== false] + }); - const _nativeID = id ?? nativeID; + const isPressable = + (onPress != null || + onLongPress != null || + onStartShouldSetResponder != null) && + _disabled !== true; - if (_accessibilityLabel !== undefined) { - processedProps.accessibilityLabel = _accessibilityLabel; - } - if (_accessibilityRole !== undefined) { - processedProps.accessibilityRole = _accessibilityRole; - } - if (_accessibilityState !== undefined) { - processedProps.accessibilityState = _accessibilityState; - } - if (_nativeID !== undefined) { - processedProps.nativeID = _nativeID; - } - if (_numberOfLines !== undefined) { - processedProps.numberOfLines = _numberOfLines; - } - if (_selectable !== undefined) { - processedProps.selectable = _selectable; - } - if (_style !== undefined) { - processedProps.style = _style; - } - if (_selectionColor !== undefined) { - processedProps.selectionColor = _selectionColor; - } - if (_role !== undefined) { - processedProps.role = _role; - } + const shouldUseLinkRole = + isPressable && accessibilityRole == null && role == null; - // [Windows accessibility properties - if (_accessibilityControls !== undefined) { - processedProps.accessibilityControls = _accessibilityControls; - } + const _accessibilityRole = + accessibilityRole ?? (shouldUseLinkRole ? 'link' : undefined); - if (_accessibilityDescribedBy !== undefined) { - processedProps.accessibilityDescribedBy = _accessibilityDescribedBy; - } + const _role = shouldUseLinkRole ? undefined : role; - if (_accessibilityDescription !== undefined) { - processedProps.accessibilityDescription = _accessibilityDescription; - } + // TODO: Move this processing to the view configuration. + const _selectionColor = + selectionColor != null ? processColor(selectionColor) : undefined; - if (_accessibilityLevel !== undefined) { - processedProps.accessibilityLevel = _accessibilityLevel; - } - if (_accessibilityPositionInSet !== undefined) { - processedProps.accessibilityPositionInSet = _accessibilityPositionInSet; + let _style = style; + if (__DEV__) { + if (PressabilityDebug.isEnabled() && onPress != null) { + _style = [style, {color: 'magenta'}]; } - if (_accessibilitySetSize !== undefined) { - processedProps.accessibilitySetSize = _accessibilitySetSize; - } - // ] + } - let textPressabilityProps: ?TextPressabilityProps; - if (isPressable) { - textPressabilityProps = { - onLongPress, - onPress, - onPressIn, - onPressOut, - onResponderGrant, - onResponderMove, - onResponderRelease, - onResponderTerminate, - onResponderTerminationRequest, - onStartShouldSetResponder, - pressRetentionOffset, - suppressHighlighting, - }; + let _numberOfLines = numberOfLines; + if (_numberOfLines != null && !(_numberOfLines >= 0)) { + if (__DEV__) { + console.error( + `'numberOfLines' in must be a non-negative number, received: ${_numberOfLines}. The value will be set to 0.`, + ); } + _numberOfLines = 0; + } - const hasTextAncestor = useContext(TextAncestorContext); - if (hasTextAncestor) { - processedProps.disabled = disabled; - processedProps.children = children; - if (isPressable) { - return ( - - ); - } - return ; - } + let _selectable = selectable; - let nativeText = null; + let processedStyle = flattenStyle(_style); + if (processedStyle != null) { + let overrides: ?{...TextStyleInternal} = null; + if (typeof processedStyle.fontWeight === 'number') { + overrides = overrides || ({}: {...TextStyleInternal}); + overrides.fontWeight = + // $FlowFixMe[incompatible-type] + (String(processedStyle.fontWeight): TextStyleInternal['fontWeight']); + } + + if (processedStyle.userSelect != null) { + _selectable = userSelectToSelectableMap[processedStyle.userSelect]; + overrides = overrides || ({}: {...TextStyleInternal}); + overrides.userSelect = undefined; + } + + if (processedStyle.verticalAlign != null) { + overrides = overrides || ({}: {...TextStyleInternal}); + overrides.textAlignVertical = + verticalAlignToTextAlignVerticalMap[processedStyle.verticalAlign]; + overrides.verticalAlign = undefined; + } + + if (overrides != null) { + // $FlowFixMe[incompatible-type] + _style = [_style, overrides]; + } + } + + const _nativeID = id ?? nativeID; + + if (_accessibilityLabel !== undefined) { + processedProps.accessibilityLabel = _accessibilityLabel; + } + if (_accessibilityRole !== undefined) { + processedProps.accessibilityRole = _accessibilityRole; + } + if (_accessibilityState !== undefined) { + processedProps.accessibilityState = _accessibilityState; + } + if (_nativeID !== undefined) { + processedProps.nativeID = _nativeID; + } + if (_numberOfLines !== undefined) { + processedProps.numberOfLines = _numberOfLines; + } + if (_selectable !== undefined) { + processedProps.selectable = _selectable; + } + if (_style !== undefined) { + processedProps.style = _style; + } + if (_selectionColor !== undefined) { + processedProps.selectionColor = _selectionColor; + } + if (_role !== undefined) { + processedProps.role = _role; + } + + // [Windows accessibility properties + if (_accessibilityControls !== undefined) { + processedProps.accessibilityControls = _accessibilityControls; + } + + if (_accessibilityDescribedBy !== undefined) { + processedProps.accessibilityDescribedBy = _accessibilityDescribedBy; + } + + if (_accessibilityDescription !== undefined) { + processedProps.accessibilityDescription = _accessibilityDescription; + } + + if (_accessibilityLevel !== undefined) { + processedProps.accessibilityLevel = _accessibilityLevel; + } + if (_accessibilityPositionInSet !== undefined) { + processedProps.accessibilityPositionInSet = _accessibilityPositionInSet; + } + if (_accessibilitySetSize !== undefined) { + processedProps.accessibilitySetSize = _accessibilitySetSize; + } + // ] + + let textPressabilityProps: ?TextPressabilityProps; + if (isPressable) { + textPressabilityProps = { + onLongPress, + onPress, + onPressIn, + onPressOut, + onResponderGrant, + onResponderMove, + onResponderRelease, + onResponderTerminate, + onResponderTerminationRequest, + onStartShouldSetResponder, + pressRetentionOffset, + suppressHighlighting, + }; + } - processedProps.accessible = _accessible; - processedProps.allowFontScaling = allowFontScaling !== false; - processedProps.disabled = _disabled; - processedProps.ellipsizeMode = ellipsizeMode ?? 'tail'; + const hasTextAncestor = useContext(TextAncestorContext); + if (hasTextAncestor) { + processedProps.disabled = disabled; processedProps.children = children; - if (isPressable) { - nativeText = ( - ); - } else { - nativeText = ; - } - - if (children == null) { - return nativeText; - } - - // If the children do not contain a JSX element it would not be possible to have a - // nested `Text` component so we can skip adding the `TextAncestorContext` context wrapper - // which has a performance overhead. Since we do this for performance reasons we need - // to keep the check simple to avoid regressing overall perf. For this reason the - // `children.length` constant is set to `3`, this should be a reasonable tradeoff - // to capture the majority of `Text` uses but also not make this check too expensive. - if (Array.isArray(children) && children.length <= 3) { - let hasNonTextChild = false; - for (let child of children) { - if (child != null && typeof child === 'object') { - hasNonTextChild = true; - break; - } - } - if (!hasNonTextChild) { - return nativeText; - } - } else if (typeof children !== 'object') { - return nativeText; - } - - return {nativeText}; - }; - _TextImpl = TextImplNoDefaultProps; -} else { - const TextImplLegacy: component( - ref?: React.RefSetter, - ...props: TextProps - ) = ({ - ref: forwardedRef, - accessible, - accessibilityElementsHidden, - importantForAccessibility, - accessibilityLabel, - accessibilityRole, - accessibilityState, - allowFontScaling, - 'aria-busy': ariaBusy, - 'aria-checked': ariaChecked, - 'aria-disabled': ariaDisabled, - 'aria-expanded': ariaExpanded, - 'aria-hidden': ariaHidden, - 'aria-label': ariaLabel, - 'aria-selected': ariaSelected, - //#[ Win32 - 'aria-controls': ariaControls, - 'aria-describedby': ariaDescribedBy, - 'aria-description': ariaDescription, - 'aria-level': ariaLevel, - 'aria-multiselectable': ariaMultiselectable, - 'aria-posinset': ariaPosinset, - 'aria-required': ariaRequired, - 'aria-setsize': ariaSetsize, - accessibilityLevel, - accessibilityPositionInSet, - accessibilitySetSize, - accessibilityControls, - accessibilityDescribedBy, - accessibilityDescription, - // #] Win32 - children, - ellipsizeMode, - disabled, - id, - nativeID, - numberOfLines, - onLongPress, - onPress, - onPressIn, - onPressOut, - onResponderGrant, - onResponderMove, - onResponderRelease, - onResponderTerminate, - onResponderTerminationRequest, - onStartShouldSetResponder, - pressRetentionOffset, - role, - selectable, - selectionColor, - suppressHighlighting, - style, - ...restProps - }: { - ref?: React.RefSetter, - ...TextProps, - }) => { - const _accessibilityLabel = ariaLabel ?? accessibilityLabel; - //#[ Win32 - const _accessibilityControls = ariaControls ?? accessibilityControls; - const _accessibilityDescribedBy = - ariaDescribedBy ?? accessibilityDescribedBy; - const _accessibilityDescription = - ariaDescription ?? accessibilityDescription; - const _accessibilityLevel = ariaLevel ?? accessibilityLevel; - const _accessibilityPositionInSet = - ariaPosinset ?? accessibilityPositionInSet; - const _accessibilitySetSize = ariaSetsize ?? accessibilitySetSize; - //#] Win32 - - let _accessibilityState: ?TextProps['accessibilityState'] = - accessibilityState; - if ( - ariaBusy != null || - ariaChecked != null || - ariaDisabled != null || - ariaExpanded != null || - ariaSelected != null - ) { - if (_accessibilityState != null) { - _accessibilityState = { - busy: ariaBusy ?? _accessibilityState.busy, - checked: ariaChecked ?? _accessibilityState.checked, - disabled: ariaDisabled ?? _accessibilityState.disabled, - expanded: ariaExpanded ?? _accessibilityState.expanded, - //#[Win32 - multiselectable: - ariaMultiselectable ?? accessibilityState?.multiselectable, - required: ariaRequired ?? accessibilityState?.required, - // #] Win32 - selected: ariaSelected ?? _accessibilityState.selected, - }; - } else { - _accessibilityState = { - busy: ariaBusy, - checked: ariaChecked, - disabled: ariaDisabled, - expanded: ariaExpanded, - // #[ Win32 - multiselectable: ariaMultiselectable, - required: ariaRequired, - // #]win32 - selected: ariaSelected, - }; - } - } - - const _accessibilityStateDisabled = _accessibilityState?.disabled; - const _disabled = disabled ?? _accessibilityStateDisabled; - - let _accessibilityElementsHidden = - ariaHidden ?? accessibilityElementsHidden; - let _importantForAccessibility = importantForAccessibility; - if (ariaHidden === true) { - _importantForAccessibility = 'no-hide-descendants'; - } - - const isPressable = - (onPress != null || - onLongPress != null || - onStartShouldSetResponder != null) && - _disabled !== true; - - const shouldUseLinkRole = - ReactNativeFeatureFlags.shouldUseLinkRoleForPressableText() && - isPressable && - accessibilityRole == null && - role == null; - - const _accessibilityRole = - accessibilityRole ?? (shouldUseLinkRole ? 'link' : undefined); - - const _role = shouldUseLinkRole ? undefined : role; - - // TODO: Move this processing to the view configuration. - const _selectionColor = - selectionColor != null ? processColor(selectionColor) : undefined; - - let _style = style; - if (__DEV__) { - if (PressabilityDebug.isEnabled() && onPress != null) { - _style = [style, {color: 'magenta'}]; - } - } - - let _numberOfLines = numberOfLines; - if (_numberOfLines != null && !(_numberOfLines >= 0)) { - if (__DEV__) { - console.error( - `'numberOfLines' in must be a non-negative number, received: ${_numberOfLines}. The value will be set to 0.`, - ); - } - _numberOfLines = 0; - } - - let _selectable = selectable; - - let processedStyle = flattenStyle(_style); - if (processedStyle != null) { - let overrides: ?{...TextStyleInternal} = null; - if (typeof processedStyle.fontWeight === 'number') { - overrides = overrides || ({}: {...TextStyleInternal}); - overrides.fontWeight = - // $FlowFixMe[incompatible-type] - (processedStyle.fontWeight.toString(): TextStyleInternal['fontWeight']); - } - - if (processedStyle.userSelect != null) { - _selectable = userSelectToSelectableMap[processedStyle.userSelect]; - overrides = overrides || ({}: {...TextStyleInternal}); - overrides.userSelect = undefined; - } - - if (processedStyle.verticalAlign != null) { - overrides = overrides || ({}: {...TextStyleInternal}); - overrides.textAlignVertical = - verticalAlignToTextAlignVerticalMap[processedStyle.verticalAlign]; - overrides.verticalAlign = undefined; - } - - if (overrides != null) { - // $FlowFixMe[incompatible-type] - _style = [_style, overrides]; - } } - - const _nativeID = id ?? nativeID; - - const hasTextAncestor = useContext(TextAncestorContext); - if (hasTextAncestor) { - if (isPressable) { - return ( - - ); + return ; + } + + let nativeText = null; + + processedProps.accessible = _accessible; + processedProps.allowFontScaling = allowFontScaling !== false; + processedProps.disabled = _disabled; + processedProps.ellipsizeMode = ellipsizeMode ?? 'tail'; + processedProps.children = children; + + if (isPressable) { + nativeText = ( + + ); + } else { + nativeText = ; + } + + if (children == null) { + return nativeText; + } + + // If the children do not contain a JSX element it would not be possible to have a + // nested `Text` component so we can skip adding the `TextAncestorContext` context wrapper + // which has a performance overhead. Since we do this for performance reasons we need + // to keep the check simple to avoid regressing overall perf. For this reason the + // `children.length` constant is set to `3`, this should be a reasonable tradeoff + // to capture the majority of `Text` uses but also not make this check too expensive. + if (Array.isArray(children) && children.length <= 3) { + let hasNonTextChild = false; + for (let child of children) { + if (child != null && typeof child === 'object') { + hasNonTextChild = true; + break; } - - return ( - - {children} - - ); - } - - // If the disabled prop and accessibilityState.disabled are out of sync but not both in - // falsy states we need to update the accessibilityState object to use the disabled prop. - if ( - _disabled !== _accessibilityStateDisabled && - ((_disabled != null && _disabled !== false) || - (_accessibilityStateDisabled != null && - _accessibilityStateDisabled !== false)) - ) { - _accessibilityState = {..._accessibilityState, disabled: _disabled}; - } - - const _accessible = Platform.select({ - ios: accessible !== false, - android: - accessible == null - ? onPress != null || onLongPress != null - : accessible, - default: accessible !== false, // [Windows #13996 - default value is accessible !== false] - }); - - let nativeText = null; - if (isPressable) { - nativeText = ( - - ); - } else { - nativeText = ( - - {children} - - ); - } - - if (children == null) { - return nativeText; } - - // If the children do not contain a JSX element it would not be possible to have a - // nested `Text` component so we can skip adding the `TextAncestorContext` context wrapper - // which has a performance overhead. Since we do this for performance reasons we need - // to keep the check simple to avoid regressing overall perf. For this reason the - // `children.length` constant is set to `3`, this should be a reasonable tradeoff - // to capture the majority of `Text` uses but also not make this check too expensive. - if (Array.isArray(children) && children.length <= 3) { - let hasNonTextChild = false; - for (let child of children) { - if (child != null && typeof child === 'object') { - hasNonTextChild = true; - break; - } - } - if (!hasNonTextChild) { - return nativeText; - } - } else if (typeof children !== 'object') { + if (!hasNonTextChild) { return nativeText; } + } else if (typeof children !== 'object') { + return nativeText; + } - return {nativeText}; - }; - _TextImpl = TextImplLegacy; -} - -const TextImpl: component( - ref?: React.RefSetter, - ...props: TextProps -) = _TextImpl; + return {nativeText}; +}; TextImpl.displayName = 'Text'; diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Types/CoreEventTypes.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Types/CoreEventTypes.win32.js index 6d89b3865dd..8d8a71e0be0 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Types/CoreEventTypes.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Types/CoreEventTypes.win32.js @@ -37,7 +37,7 @@ export type ResponderSyntheticEvent = Readonly<{ indexOfSingleActiveTouch: number, mostRecentTimeStamp: number, numberActiveTouches: number, - touchBank: $ReadOnlyArray< + touchBank: ReadonlyArray< Readonly<{ touchActive: boolean, startPageX: number, @@ -237,10 +237,11 @@ export type NativeTouchEvent = Readonly<{ /** * Array of all touch events that have changed since the last event */ - changedTouches: $ReadOnlyArray, + changedTouches: ReadonlyArray, ctrlKey: ?boolean, // TODO(macOS) + /** * 3D Touch reported force * @platform ios @@ -282,7 +283,7 @@ export type NativeTouchEvent = Readonly<{ /** * Array of all current touches on the screen */ - touches: $ReadOnlyArray, + touches: ReadonlyArray, }>; export type GestureResponderEvent = ResponderSyntheticEvent; diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Utilities/useMergeRefs.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Utilities/useMergeRefs.js index 5e6f2957878..3f76a0b3392 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Utilities/useMergeRefs.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Utilities/useMergeRefs.js @@ -22,11 +22,11 @@ import {useCallback} from 'react'; * lead to problems with the given refs being invoked more times than desired. */ export default function useMergeRefs( - ...refs: $ReadOnlyArray> + ...refs: ReadonlyArray> ): React.RefSetter { const refEffect = useCallback( (current: Instance) => { - const cleanups: $ReadOnlyArray void)> = refs.map(ref => { + const cleanups: ReadonlyArray void)> = refs.map(ref => { if (ref == null) { return undefined; } else { diff --git a/packages/@office-iss/react-native-win32/src-win/index.win32.js b/packages/@office-iss/react-native-win32/src-win/index.win32.js index ff17b4b86d4..373668ae2ab 100644 --- a/packages/@office-iss/react-native-win32/src-win/index.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/index.win32.js @@ -42,6 +42,9 @@ module.exports = { return require('./Libraries/Components/DrawerAndroid/DrawerLayoutAndroid') .default; }, + get EventEmitter() { + return require('./Libraries/vendor/emitter/EventEmitter').default; + }, get FlatList() { return require('./Libraries/Lists/FlatList').default; }, diff --git a/packages/@office-iss/react-native-win32/src-win/index.win32.js.flow b/packages/@office-iss/react-native-win32/src-win/index.win32.js.flow index 68a26452966..2b78dddcb35 100644 --- a/packages/@office-iss/react-native-win32/src-win/index.win32.js.flow +++ b/packages/@office-iss/react-native-win32/src-win/index.win32.js.flow @@ -324,7 +324,6 @@ export * as NativeComponentRegistry from './Libraries/NativeComponent/NativeComp export {default as NativeDialogManagerAndroid} from './Libraries/NativeModules/specs/NativeDialogManagerAndroid'; export type { - EventSubscription, EmitterSubscription, NativeEventSubscription, } from './Libraries/EventEmitter/NativeEventEmitter'; @@ -467,6 +466,12 @@ export type { PublicTextInstance, } from './Libraries/ReactPrivate/ReactNativePrivateInterface'; +export type { + EventSubscription, + IEventEmitter, +} from './Libraries/vendor/emitter/EventEmitter'; +export {default as EventEmitter} from './Libraries/vendor/emitter/EventEmitter'; + export { default as unstable_VirtualView, VirtualViewMode, diff --git a/packages/@office-iss/react-native-win32/src-win/src/private/animated/NativeAnimatedHelper.win32.js b/packages/@office-iss/react-native-win32/src-win/src/private/animated/NativeAnimatedHelper.win32.js index c74f94eedd5..06e51ad1239 100644 --- a/packages/@office-iss/react-native-win32/src-win/src/private/animated/NativeAnimatedHelper.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/src/private/animated/NativeAnimatedHelper.win32.js @@ -103,7 +103,7 @@ function createNativeOperations(): NonNullable { methodNames.push('connectAnimatedNodeToShadowNodeFamily'); } const nativeOperations: { - [Values]: (...$ReadOnlyArray) => void, + [Values]: (...ReadonlyArray) => void, } = {}; if (isSingleOpBatching) { for (let ii = 0, length = methodNames.length; ii < length; ii++) { diff --git a/packages/@react-native-windows/automation-channel/package.json b/packages/@react-native-windows/automation-channel/package.json index e4378807575..4ccd533aeae 100644 --- a/packages/@react-native-windows/automation-channel/package.json +++ b/packages/@react-native-windows/automation-channel/package.json @@ -33,7 +33,7 @@ "just-scripts": "^1.3.2", "prettier": "^3.6.2", "react": "19.2.3", - "react-native": "0.85.0-nightly-20260114-f15985f4f", + "react-native": "0.85.0-nightly-20260128-36f07a1b2", "react-native-windows": "^0.0.0-canary.1056", "typescript": "5.0.4" }, diff --git a/packages/@react-native-windows/cli/package.json b/packages/@react-native-windows/cli/package.json index f128b68986c..353312980ee 100644 --- a/packages/@react-native-windows/cli/package.json +++ b/packages/@react-native-windows/cli/package.json @@ -66,7 +66,7 @@ "jest": "^29.7.0", "prettier": "^3.6.2", "react": "19.2.3", - "react-native": "0.85.0-nightly-20260114-f15985f4f", + "react-native": "0.85.0-nightly-20260128-36f07a1b2", "typescript": "5.0.4" }, "peerDependencies": { diff --git a/packages/@react-native-windows/perf-testing/package.json b/packages/@react-native-windows/perf-testing/package.json index 826f9755f80..d0a3b6f826b 100644 --- a/packages/@react-native-windows/perf-testing/package.json +++ b/packages/@react-native-windows/perf-testing/package.json @@ -36,7 +36,7 @@ "peerDependencies": { "jest": ">=29.0.3", "react": ">=18.0.0", - "react-native": "0.85.0-nightly-20260114-f15985f4f", + "react-native": "0.85.0-nightly-20260128-36f07a1b2", "react-test-renderer": ">=18.0.0" }, "peerDependenciesMeta": { diff --git a/packages/@react-native-windows/tester/overrides.json b/packages/@react-native-windows/tester/overrides.json index 645ad8067aa..b85f27e401a 100644 --- a/packages/@react-native-windows/tester/overrides.json +++ b/packages/@react-native-windows/tester/overrides.json @@ -5,7 +5,7 @@ "excludePatterns": [ "src/js/examples-win/**" ], - "baseVersion": "0.85.0-nightly-20260114-f15985f4f", + "baseVersion": "0.85.0-nightly-20260128-36f07a1b2", "overrides": [ { "type": "copy", @@ -85,7 +85,7 @@ "type": "patch", "file": "src/js/examples/Image/ImageExample.windows.js", "baseFile": "packages/rn-tester/js/examples/Image/ImageExample.js", - "baseHash": "3fc18bff48bbe9506ebe9d200828143b3b79a391", + "baseHash": "c8ce9454827962d202cda42bd6bcd0aaceb8cf74", "issue": 12869 }, { @@ -111,13 +111,13 @@ "type": "derived", "file": "src/js/examples/Text/TextExample.windows.js", "baseFile": "packages/rn-tester/js/examples/Text/TextExample.android.js", - "baseHash": "bcf37a6cfe71ae8d9034349c8f61f8fac2c8c2b6" + "baseHash": "ea9a9fec30ff987396c4be119eb4b38492a37e65" }, { "type": "patch", "file": "src/js/examples/Text/TextSharedExamples.windows.js", "baseFile": "packages/rn-tester/js/examples/Text/TextSharedExamples.js", - "baseHash": "276177eac14554bc145ccd4125a97ad2b24ea9f3", + "baseHash": "66789820f73a9ea8f6044df08cef5726112cc8cd", "issue": 15125 }, { diff --git a/packages/@react-native-windows/tester/package.json b/packages/@react-native-windows/tester/package.json index 41e503d9a6d..a87745bac8b 100644 --- a/packages/@react-native-windows/tester/package.json +++ b/packages/@react-native-windows/tester/package.json @@ -19,7 +19,7 @@ "peerDependencies": { "@react-native-picker/picker": "2.11.0", "react": "19.2.3", - "react-native": "0.85.0-nightly-20260114-f15985f4f", + "react-native": "0.85.0-nightly-20260128-36f07a1b2", "react-native-windows": "^0.0.0-canary.1056", "react-native-xaml": "^0.0.80" }, @@ -32,8 +32,8 @@ } }, "devDependencies": { - "@react-native/new-app-screen": "0.85.0-nightly-20260114-f15985f4f", - "@react-native/tester": "0.85.0-nightly-20260114-f15985f4f", + "@react-native/new-app-screen": "0.85.0-nightly-20260128-36f07a1b2", + "@react-native/tester": "0.85.0-nightly-20260128-36f07a1b2", "@rnw-scripts/babel-react-native-config": "0.0.0", "@rnw-scripts/eslint-config": "1.2.38", "@rnw-scripts/just-task": "2.3.58", @@ -43,7 +43,7 @@ "just-scripts": "^1.3.3", "prettier": "^3.6.2", "react": "19.2.3", - "react-native": "0.85.0-nightly-20260114-f15985f4f", + "react-native": "0.85.0-nightly-20260128-36f07a1b2", "react-native-platform-override": "0.0.0-canary.1022", "react-native-windows": "^0.0.0-canary.1056", "typescript": "5.0.4" diff --git a/packages/@react-native-windows/tester/src/js/examples/Image/ImageExample.windows.js b/packages/@react-native-windows/tester/src/js/examples/Image/ImageExample.windows.js index 90c93e475fe..6b316e9e981 100644 --- a/packages/@react-native-windows/tester/src/js/examples/Image/ImageExample.windows.js +++ b/packages/@react-native-windows/tester/src/js/examples/Image/ImageExample.windows.js @@ -95,7 +95,7 @@ const NetworkImageCallbackExample = ({ source, prefetchedSource, }: NetworkImageCallbackExampleProps): React.Node => { - const [events, setEvents] = useState<$ReadOnlyArray>([]); + const [events, setEvents] = useState>([]); const [startLoadPrefetched, setStartLoadPrefetched] = useState(false); const [mountTime, setMountTime] = useState(Date.now()); @@ -212,7 +212,7 @@ const NetworkImageCallbackExample = ({ type NetworkImageExampleState = { error: ?string, loading: boolean, - progress: $ReadOnlyArray, + progress: ReadonlyArray, }; class NetworkImageExample extends React.Component< diff --git a/packages/@react-native-windows/tester/src/js/examples/Text/TextExample.windows.js b/packages/@react-native-windows/tester/src/js/examples/Text/TextExample.windows.js index c0b9f31cc31..464a9a165c7 100644 --- a/packages/@react-native-windows/tester/src/js/examples/Text/TextExample.windows.js +++ b/packages/@react-native-windows/tester/src/js/examples/Text/TextExample.windows.js @@ -393,6 +393,16 @@ function FontVariantsExample(props: {}): React.Node { 1111{'\n'} 2222{'\n'} + + Non-Stylistic & and $ + + + Stylistic & and $ + ); } diff --git a/packages/@react-native/monorepo/overrides.json b/packages/@react-native/monorepo/overrides.json index 8dcbb9b1205..ac0750292df 100644 --- a/packages/@react-native/monorepo/overrides.json +++ b/packages/@react-native/monorepo/overrides.json @@ -1,11 +1,11 @@ { - "baseVersion": "0.85.0-nightly-20260114-f15985f4f", + "baseVersion": "0.85.0-nightly-20260128-36f07a1b2", "overrides": [ { "type": "patch", "file": "package.json", "baseFile": "package.json", - "baseHash": "0631acd5a8c37dae02d71cd7ba5ac0125c89fa31" + "baseHash": "f1c98cbb9622bb734c0c04941badd65a1200fe5a" } ] } \ No newline at end of file diff --git a/packages/@react-native/monorepo/package.json b/packages/@react-native/monorepo/package.json index 9c838639545..45dcfba909d 100644 --- a/packages/@react-native/monorepo/package.json +++ b/packages/@react-native/monorepo/package.json @@ -51,8 +51,8 @@ "@jest/create-cache-key-function": "^29.7.0", "@microsoft/api-extractor": "^7.52.2", "@octokit/rest": "^22.0.0", - "@react-native/metro-babel-transformer": "0.85.0-nightly-20260114-f15985f4f", - "@react-native/metro-config": "0.85.0-nightly-20260114-f15985f4f", + "@react-native/metro-babel-transformer": "0.85.0-nightly-20260128-36f07a1b2", + "@react-native/metro-config": "0.85.0-nightly-20260128-36f07a1b2", "@tsconfig/node22": "22.0.2", "@types/react": "^19.2.3", "@typescript-eslint/parser": "^8.36.0", @@ -73,13 +73,13 @@ "eslint-plugin-ft-flow": "^2.0.1", "eslint-plugin-jest": "^29.0.1", "eslint-plugin-jsx-a11y": "^6.6.0", - "eslint-plugin-react": "^7.30.1", + "eslint-plugin-react": "^7.37.5", "eslint-plugin-react-native": "^5.0.0", "eslint-plugin-redundant-undefined": "^0.4.0", "eslint-plugin-relay": "^1.8.3", "fb-dotslash": "0.5.8", "flow-api-translator": "0.33.3", - "flow-bin": "^0.296.1", + "flow-bin": "^0.298.0", "hermes-eslint": "0.33.3", "hermes-transform": "0.33.3", "ini": "^5.0.0", @@ -100,7 +100,7 @@ "node-fetch": "^2.2.0", "nullthrows": "^1.1.1", "prettier": "3.6.2", - "prettier-plugin-hermes-parser": "0.32.0", + "prettier-plugin-hermes-parser": "0.33.2", "react": "19.2.3", "react-test-renderer": "19.2.3", "rimraf": "^3.0.2", diff --git a/packages/@react-native/tester/NativeComponentExample/js/MyNativeViewNativeComponent.js b/packages/@react-native/tester/NativeComponentExample/js/MyNativeViewNativeComponent.js index 8487b4e2bc0..093b8d80af7 100644 --- a/packages/@react-native/tester/NativeComponentExample/js/MyNativeViewNativeComponent.js +++ b/packages/@react-native/tester/NativeComponentExample/js/MyNativeViewNativeComponent.js @@ -14,14 +14,14 @@ import * as React from 'react'; import {codegenNativeCommands, codegenNativeComponent} from 'react-native'; type Event = Readonly<{ - values: $ReadOnlyArray, - boolValues: $ReadOnlyArray, - floats: $ReadOnlyArray, - doubles: $ReadOnlyArray, - yesNos: $ReadOnlyArray<'yep' | 'nope'>, - strings: $ReadOnlyArray, - latLons: $ReadOnlyArray<{lat: CodegenTypes.Double, lon: CodegenTypes.Double}>, - multiArrays: $ReadOnlyArray<$ReadOnlyArray>, + values: ReadonlyArray, + boolValues: ReadonlyArray, + floats: ReadonlyArray, + doubles: ReadonlyArray, + yesNos: ReadonlyArray<'yep' | 'nope'>, + strings: ReadonlyArray, + latLons: ReadonlyArray<{lat: CodegenTypes.Double, lon: CodegenTypes.Double}>, + multiArrays: ReadonlyArray>, }>; type LegacyStyleEvent = Readonly<{ @@ -31,7 +31,7 @@ type LegacyStyleEvent = Readonly<{ type NativeProps = Readonly<{ ...ViewProps, opacity?: CodegenTypes.Float, - values: $ReadOnlyArray, + values: ReadonlyArray, // Events onIntArrayChanged?: ?CodegenTypes.BubblingEventHandler, @@ -51,7 +51,7 @@ interface NativeCommands { +callNativeMethodToAddOverlays: ( viewRef: React.ElementRef, - overlayColors: $ReadOnlyArray, + overlayColors: ReadonlyArray, ) => void; +callNativeMethodToRemoveOverlays: ( diff --git a/packages/@react-native/tester/js/components/RNTesterExampleFilter.js b/packages/@react-native/tester/js/components/RNTesterExampleFilter.js index b7835692de1..4dc4c556a9a 100644 --- a/packages/@react-native/tester/js/components/RNTesterExampleFilter.js +++ b/packages/@react-native/tester/js/components/RNTesterExampleFilter.js @@ -30,7 +30,7 @@ type Props = { testID?: string, hideFilterPills?: boolean, page: 'examples_page' | 'components_page', - sections: $ReadOnlyArray>, + sections: ReadonlyArray>, ... }; @@ -81,7 +81,7 @@ class RNTesterExampleFilter extends React.Component, State> { } _renderFilteredSections( - filteredSections: $ReadOnlyArray<{ + filteredSections: ReadonlyArray<{ data: Array, key: string, title: string, diff --git a/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTest.js b/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTest.js index fa81bc61873..4ba3617667e 100644 --- a/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTest.js +++ b/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTest.js @@ -19,7 +19,7 @@ import {StyleSheet, Text, View} from 'react-native'; type Props = Readonly<{ title: string, description: string, - instructions?: $ReadOnlyArray, + instructions?: ReadonlyArray, component: React.ComponentType, }>; diff --git a/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestEventRecorder.js b/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestEventRecorder.js index a704a67212d..4c71347d85b 100644 --- a/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestEventRecorder.js +++ b/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestEventRecorder.js @@ -102,7 +102,7 @@ export default class RNTesterPlatformTestEventRecorder { } createRecorderTestEventHandlers( - targetNames: $ReadOnlyArray, + targetNames: ReadonlyArray, callback?: (event: Object, eventType: string, targetName: string) => void, ): Readonly<{[targetName: string]: ViewProps}> { const result: {[targetName: string]: ViewProps} = {}; @@ -171,7 +171,7 @@ export default class RNTesterPlatformTestEventRecorder { export function useRecorderTestEventHandlers( eventRecorder: RNTesterPlatformTestEventRecorder, - targetNames: $ReadOnlyArray, + targetNames: ReadonlyArray, callback?: (event: Object, eventType: string, targetName: string) => void, ): Readonly<{[targetName: string]: ViewProps}> { return useMemo( diff --git a/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestInstructions.js b/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestInstructions.js index 98bd0726bba..5bf85d98ba8 100644 --- a/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestInstructions.js +++ b/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestInstructions.js @@ -14,7 +14,7 @@ import * as React from 'react'; import {StyleSheet, Text, View} from 'react-native'; type Props = Readonly<{ - instructions?: $ReadOnlyArray, + instructions?: ReadonlyArray, style?: ?ViewStyleProp, }>; export default function RNTesterPlatformTestInstructions({ diff --git a/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestResultView.js b/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestResultView.js index b4716abc957..0b814621eb6 100644 --- a/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestResultView.js +++ b/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestResultView.js @@ -179,7 +179,7 @@ function renderTableRow({item}: ListRenderItemInfo) { type Props = Readonly<{ numPending: number, reset: () => void, - results: $ReadOnlyArray, + results: ReadonlyArray, style?: ?ViewStyleProp, }>; export default function RNTesterPlatformTestResultView( diff --git a/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestTypes.js b/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestTypes.js index 0ecba3d2487..a17182b7e4d 100644 --- a/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestTypes.js +++ b/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestTypes.js @@ -33,7 +33,7 @@ export type PlatformTestResultStatus = 'PASS' | 'FAIL' | 'ERROR' | 'SKIPPED'; export type PlatformTestResult = Readonly<{ name: string, status: PlatformTestResultStatus, - assertions: $ReadOnlyArray, + assertions: ReadonlyArray, error: unknown | null, // null is technically unnecessary but is kept to ensure the error is described as nullable }>; diff --git a/packages/@react-native/tester/js/examples/Experimental/PlatformTest/usePlatformTestHarness.js b/packages/@react-native/tester/js/examples/Experimental/PlatformTest/usePlatformTestHarness.js index 0f8c88ddc67..a4f21b2ec02 100644 --- a/packages/@react-native/tester/js/examples/Experimental/PlatformTest/usePlatformTestHarness.js +++ b/packages/@react-native/tester/js/examples/Experimental/PlatformTest/usePlatformTestHarness.js @@ -136,12 +136,12 @@ export type PlatformTestHarnessHookResult = Readonly<{ harness: PlatformTestHarness, numPending: number, reset: () => void, - results: $ReadOnlyArray, + results: ReadonlyArray, }>; export default function usePlatformTestHarness(): PlatformTestHarnessHookResult { const [testResults, updateTestResults] = useState< - $ReadOnlyArray, + ReadonlyArray, >([]); // Since updating the test results array can get expensive at larger sizes diff --git a/packages/@react-native/tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventSupport.js b/packages/@react-native/tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventSupport.js index 419cda04fc3..7509fe8b5a9 100644 --- a/packages/@react-native/tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventSupport.js +++ b/packages/@react-native/tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventSupport.js @@ -212,7 +212,7 @@ export function check_PointerEvent( * view events with the same handler */ export function useTestEventHandler( - eventNames: $ReadOnlyArray, + eventNames: ReadonlyArray, handler: (event: any, eventName: string) => void, ): ViewProps { const eventProps: any = useMemo(() => { diff --git a/packages/@react-native/tester/js/examples/Image/ImageExample.js b/packages/@react-native/tester/js/examples/Image/ImageExample.js index a1da1e93132..615743285e8 100644 --- a/packages/@react-native/tester/js/examples/Image/ImageExample.js +++ b/packages/@react-native/tester/js/examples/Image/ImageExample.js @@ -87,7 +87,7 @@ const NetworkImageCallbackExample = ({ source, prefetchedSource, }: NetworkImageCallbackExampleProps): React.Node => { - const [events, setEvents] = useState<$ReadOnlyArray>([]); + const [events, setEvents] = useState>([]); const [startLoadPrefetched, setStartLoadPrefetched] = useState(false); const [mountTime, setMountTime] = useState(Date.now()); @@ -197,7 +197,7 @@ const NetworkImageCallbackExample = ({ type NetworkImageExampleState = { error: ?string, loading: boolean, - progress: $ReadOnlyArray, + progress: ReadonlyArray, }; class NetworkImageExample extends React.Component< diff --git a/packages/@react-native/tester/js/examples/IntersectionObserver/IntersectionObserverClippingParent.js b/packages/@react-native/tester/js/examples/IntersectionObserver/IntersectionObserverClippingParent.js index ce4f3e12bcd..09ba32a1f19 100644 --- a/packages/@react-native/tester/js/examples/IntersectionObserver/IntersectionObserverClippingParent.js +++ b/packages/@react-native/tester/js/examples/IntersectionObserver/IntersectionObserverClippingParent.js @@ -72,7 +72,7 @@ function IntersectionObserverCustomClippingRootExample(): React.Node { const [rootMarginValue, setRootMarginValue] = useState('0px'); const onObserve = useCallback( - (entries: $ReadOnlyArray) => { + (entries: ReadonlyArray) => { entries.forEach(entry => { setIntersectionEntry(entry); }); diff --git a/packages/@react-native/tester/js/examples/IntersectionObserver/IntersectionObserverClippingRoot.js b/packages/@react-native/tester/js/examples/IntersectionObserver/IntersectionObserverClippingRoot.js index 3bf9c3af192..02c832aeb24 100644 --- a/packages/@react-native/tester/js/examples/IntersectionObserver/IntersectionObserverClippingRoot.js +++ b/packages/@react-native/tester/js/examples/IntersectionObserver/IntersectionObserverClippingRoot.js @@ -77,7 +77,7 @@ function IntersectionObserverClippingRootExample(): React.Node { }, [rootMarginInput]); const onObserve = useCallback( - (entries: $ReadOnlyArray) => { + (entries: ReadonlyArray) => { entries.forEach(entry => { setIntersectionEntry(entry); }); diff --git a/packages/@react-native/tester/js/examples/IntersectionObserver/IntersectionObserverExplicitRoot.js b/packages/@react-native/tester/js/examples/IntersectionObserver/IntersectionObserverExplicitRoot.js index f569b586523..3bddaaa610c 100644 --- a/packages/@react-native/tester/js/examples/IntersectionObserver/IntersectionObserverExplicitRoot.js +++ b/packages/@react-native/tester/js/examples/IntersectionObserver/IntersectionObserverExplicitRoot.js @@ -75,7 +75,7 @@ function IntersectionObserverExplicitRootExample(): React.Node { [position], ); const onObserve = useCallback( - (entries: $ReadOnlyArray) => { + (entries: ReadonlyArray) => { entries.forEach(entry => { setIntersectionRatio(entry.intersectionRatio); }); diff --git a/packages/@react-native/tester/js/examples/Performance/PerformanceApiExample.js b/packages/@react-native/tester/js/examples/Performance/PerformanceApiExample.js index cc8f8c4f296..09fea74bd42 100644 --- a/packages/@react-native/tester/js/examples/Performance/PerformanceApiExample.js +++ b/packages/@react-native/tester/js/examples/Performance/PerformanceApiExample.js @@ -79,7 +79,7 @@ function StartupTimingExample(): React.Node { } function PerformanceObserverUserTimingExample(): React.Node { - const [entries, setEntries] = useState<$ReadOnlyArray>([]); + const [entries, setEntries] = useState>([]); useEffect(() => { const observer = new PerformanceObserver(list => { @@ -131,13 +131,13 @@ function PerformanceObserverUserTimingExample(): React.Node { function PerformanceObserverEventTimingExample(): React.Node { const [count, setCount] = useState(0); - const [entries, setEntries] = useState< - $ReadOnlyArray, - >([]); + const [entries, setEntries] = useState>( + [], + ); useEffect(() => { const observer = new PerformanceObserver(list => { - const newEntries: $ReadOnlyArray = + const newEntries: ReadonlyArray = // $FlowExpectedError[incompatible-type] This is guaranteed because we're only observing `event` entry types. list.getEntries(); setEntries(newEntries); @@ -182,7 +182,7 @@ function PerformanceObserverEventTimingExample(): React.Node { } function PerformanceObserverLongtaskExample(): React.Node { - const [entries, setEntries] = useState<$ReadOnlyArray>([]); + const [entries, setEntries] = useState>([]); useEffect(() => { const observer = new PerformanceObserver(list => { diff --git a/packages/@react-native/tester/js/examples/RefreshControl/RefreshControlExample.js b/packages/@react-native/tester/js/examples/RefreshControl/RefreshControlExample.js index 6926a8c9428..c05b3062f20 100644 --- a/packages/@react-native/tester/js/examples/RefreshControl/RefreshControlExample.js +++ b/packages/@react-native/tester/js/examples/RefreshControl/RefreshControlExample.js @@ -68,7 +68,7 @@ class Row extends React.Component< type RefreshControlExampleState = Readonly<{ isRefreshing: boolean, loaded: number, - rowData: $ReadOnlyArray, + rowData: ReadonlyArray, }>; class RefreshControlExample extends React.Component< diff --git a/packages/@react-native/tester/js/examples/ScrollView/ScrollViewExample.js b/packages/@react-native/tester/js/examples/ScrollView/ScrollViewExample.js index 8f175a5437b..11abb88cde7 100644 --- a/packages/@react-native/tester/js/examples/ScrollView/ScrollViewExample.js +++ b/packages/@react-native/tester/js/examples/ScrollView/ScrollViewExample.js @@ -545,6 +545,14 @@ if (Platform.OS === 'ios') { return ; }, }); + examples.push({ + title: ' scrollsChildToFocus\n', + description: + 'When false, the ScrollView will not automatically scroll to a focused child. Useful for controlling scroll position programmatically.', + render(): React.Node { + return ; + }, + }); } exports.examples = examples; @@ -566,6 +574,42 @@ const AndroidScrollBarOptions = () => { ); }; +const ScrollsChildToFocusExample = () => { + const [scrollsChildToFocus, setScrollsChildToFocus] = useState(true); + return ( + + + Focus a TextInput below to see the scroll behavior. + + + + + + + + + + + + +