From 4a4a8162adac8aae9055dbf8483408bb80776307 Mon Sep 17 00:00:00 2001 From: Sam Zhou Date: Fri, 4 Sep 2026 10:32:22 -0700 Subject: [PATCH] Deploy 0.331.0 to xplat Summary: [changelog](https://github.com/facebook/flow/blob/main/Changelog.md) Changelog: [Internal] Differential Revision: D118823256 --- .flowconfig | 2 +- flow-typed/npm/react-dom_v17.x.x.js | 20 +++++++++---------- package.json | 2 +- .../Animated/components/AnimatedScrollView.js | 12 +++++------ .../examples/ScrollView/ScrollViewExample.js | 4 ++-- .../Lists/VirtualizedList.js | 6 +++--- yarn.lock | 8 ++++---- 7 files changed, 25 insertions(+), 29 deletions(-) diff --git a/.flowconfig b/.flowconfig index 86d938df17c1..4db110a0acfe 100644 --- a/.flowconfig +++ b/.flowconfig @@ -86,4 +86,4 @@ untyped-import untyped-type-import [version] -^0.330.0 +^0.331.0 diff --git a/flow-typed/npm/react-dom_v17.x.x.js b/flow-typed/npm/react-dom_v17.x.x.js index 2aa09e1b8871..f9423ba34193 100644 --- a/flow-typed/npm/react-dom_v17.x.x.js +++ b/flow-typed/npm/react-dom_v17.x.x.js @@ -7,17 +7,17 @@ declare module 'react-dom' { componentOrElement: Element | ?Component, ): null | Element | Text; - declare function render( - element: ExactReactElement_DEPRECATED, + declare function render( + element: React.MixedElement, container: Element, callback?: () => void, - ): React.ElementRef; + ): unknown; - declare function hydrate( - element: ExactReactElement_DEPRECATED, + declare function hydrate( + element: React.MixedElement, container: Element, callback?: () => void, - ): React.ElementRef; + ): unknown; declare function createPortal( node: React.Node, @@ -35,14 +35,12 @@ declare module 'react-dom' { e: E, ): void; - declare function unstable_renderSubtreeIntoContainer< - ElementType: React.ElementType, - >( + declare function unstable_renderSubtreeIntoContainer( parentComponent: Component, - nextElement: ExactReactElement_DEPRECATED, + nextElement: React.MixedElement, container: any, callback?: () => void, - ): React.ElementRef; + ): unknown; } declare module 'react-dom/server' { diff --git a/package.json b/package.json index f27f754f8fde..58a0de89937a 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,7 @@ "eslint-plugin-relay": "^1.8.3", "fb-dotslash": "0.5.8", "flow-api-translator": "0.327.0", - "flow-bin": "^0.330.0", + "flow-bin": "^0.331.0", "flow-eslint": "0.327.0", "flow-parser": "0.327.0", "flow-transform": "0.327.0", diff --git a/packages/react-native/Libraries/Animated/components/AnimatedScrollView.js b/packages/react-native/Libraries/Animated/components/AnimatedScrollView.js index 7a1a1d7b32ec..9ba8f735c94e 100644 --- a/packages/react-native/Libraries/Animated/components/AnimatedScrollView.js +++ b/packages/react-native/Libraries/Animated/components/AnimatedScrollView.js @@ -14,7 +14,6 @@ import type { AnimatedProps, } from '../createAnimatedComponent'; -import RefreshControl from '../../Components/RefreshControl/RefreshControl'; import ScrollView, { type ScrollViewProps, } from '../../Components/ScrollView/ScrollView'; @@ -83,7 +82,7 @@ const AnimatedScrollViewWithInvertedRefreshControl = ref?: React.RefSetter, ...React.ElementConfig, // $FlowFixMe[unclear-type] Same Flow type as `refreshControl` in ScrollView - refreshControl: ExactReactElement_DEPRECATED, + refreshControl: React.MixedElement, }) { // Split `props` into the animate-able props for the parent (RefreshControl) // and child (ScrollView). @@ -105,11 +104,10 @@ const AnimatedScrollViewWithInvertedRefreshControl = >(intermediatePropsForRefreshControl); // NOTE: Assumes that refreshControl.ref` and `refreshControl.style` can be // safely clobbered. - const refreshControl: ExactReactElement_DEPRECATED = - cloneElement(props.refreshControl, { - ...refreshControlAnimatedProps, - ref: refreshControlRef, - }); + const refreshControl = cloneElement(props.refreshControl, { + ...refreshControlAnimatedProps, + ref: refreshControlRef, + }); // Handle animated props on `NativeDirectionalScrollView`. const [scrollViewAnimatedProps, scrollViewRef] = useAnimatedProps< diff --git a/packages/rn-tester/js/examples/ScrollView/ScrollViewExample.js b/packages/rn-tester/js/examples/ScrollView/ScrollViewExample.js index 11abb88cde7a..e15601999663 100644 --- a/packages/rn-tester/js/examples/ScrollView/ScrollViewExample.js +++ b/packages/rn-tester/js/examples/ScrollView/ScrollViewExample.js @@ -64,9 +64,9 @@ class EnableDisableList extends React.Component<{}, {scrollEnabled: boolean}> { let AppendingListItemCount = 6; class AppendingList extends React.Component< {}, - {items: Array>>}, + {items: ReadonlyArray}, > { - state: {items: Array>>} = { + state: {items: ReadonlyArray} = { items: [...Array(AppendingListItemCount)].map((_, ii) => ( )), diff --git a/packages/virtualized-lists/Lists/VirtualizedList.js b/packages/virtualized-lists/Lists/VirtualizedList.js index b88c980f4755..e78dc3738839 100644 --- a/packages/virtualized-lists/Lists/VirtualizedList.js +++ b/packages/virtualized-lists/Lists/VirtualizedList.js @@ -910,7 +910,7 @@ class VirtualizedList extends StateSafePureComponent< } _renderEmptyComponent( - element: ExactReactElement_DEPRECATED, + element: React.MixedElement, inversionStyle: StyleProp, ): React.Node { // $FlowFixMe[prop-missing] React.Element internal inspection @@ -985,7 +985,7 @@ class VirtualizedList extends StateSafePureComponent< // 2a. Add a cell for ListEmptyComponent if applicable const itemCount = this.props.getItemCount(data); if (itemCount === 0 && ListEmptyComponent) { - const element: ExactReactElement_DEPRECATED = ( + const element: React.MixedElement = ( isValidElement(ListEmptyComponent) ? ( ListEmptyComponent ) : ( @@ -1154,7 +1154,7 @@ class VirtualizedList extends StateSafePureComponent< )( // $FlowExpectedError[incompatible-type] scrollProps is a superset of ScrollViewProps scrollProps, - ) as ExactReactElement_DEPRECATED, + ) as React.JSX.Element, { ref: this._captureScrollRef, }, diff --git a/yarn.lock b/yarn.lock index ea26dc8b37e6..813888ae07f9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4787,10 +4787,10 @@ flow-api-translator@0.327.0: flow-transform "0.327.0" typescript "5.3.2" -flow-bin@^0.330.0: - version "0.330.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.330.0.tgz#4851fec2d41e8a871eebfd21beecf0c603068ddb" - integrity sha512-rlGZslBZBOPmMrm7mqtn0r1lZe2jbngmcSThVwThj8c49k4WQ46ZBLAyr98Bx9Smx6TqXPyam6piUKOcBBteKg== +flow-bin@^0.331.0: + version "0.331.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.331.0.tgz#a9fb60c16a47084a081a6f5ea56e9f41c7e4e173" + integrity sha512-GRM2hiixc8gE2q6AoolTfgtS4tWS1sced0iQAbOmZ5jCD/GTsGSINoM/6ENu1oAjqmodWA4H+1qyNhVb+r3V3A== flow-enums-runtime@^0.0.6: version "0.0.6"