From 4eb4264f69b9e87608884bac927641e1bf1a8b9d Mon Sep 17 00:00:00 2001 From: Sam Zhou Date: Sun, 1 Nov 2026 07:33:24 -0800 Subject: [PATCH] Pass an explicit type argument to the StatusBar props-stack `reduce` Summary: `mergePropsStack` folds a `StackProps` array into a `ResolvedStackProps` accumulator, starting from a spread of the defaults. Once Flow's library adds TypeScript's `reduce(callbackfn, initialValue: T): T` overload, that call picks it, because the initial value is also a valid `StackProps`, and the accumulator becomes `StackProps`. Pass `ResolvedStackProps` explicitly so the generic overload is used. Nothing changes at runtime. Changelog: [Internal] Differential Revision: D128883774 --- .../react-native/Libraries/Components/StatusBar/StatusBar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/Libraries/Components/StatusBar/StatusBar.js b/packages/react-native/Libraries/Components/StatusBar/StatusBar.js index bab23467263c..3d4d68245a75 100644 --- a/packages/react-native/Libraries/Components/StatusBar/StatusBar.js +++ b/packages/react-native/Libraries/Components/StatusBar/StatusBar.js @@ -141,7 +141,7 @@ function mergePropsStack( propsStack: Array, defaultValues: ResolvedStackProps, ): ResolvedStackProps { - const merged: ResolvedStackProps = propsStack.reduce( + const merged: ResolvedStackProps = propsStack.reduce( (prev, cur) => { for (const prop in cur) { // $FlowFixMe[invalid-computed-prop] dynamic merge over the known StackProps keys