From f7ea40bc28605fb712910e20d150af0bb9942611 Mon Sep 17 00:00:00 2001 From: SimpleCreations Date: Fri, 26 Sep 2025 10:13:27 -0700 Subject: [PATCH] Fix TypeScript types of `positions` in `GradientValue` (#53942) Summary: The original type of the `positions` property was mistakenly declared as a 2-dimensional array, which is not accepted in runtime. In reality, a flat string array is expected as per [linear gradient examples](https://github.com/facebook/react-native/blob/18ba21149ae46d3fa97fe0dcbe165999009d2a6e/packages/rn-tester/js/examples/LinearGradient/LinearGradientExample.js#L230). ## Changelog: [General] [Fixed] - TypeScript types of `positions` in `GradientValue` Pull Request resolved: https://github.com/facebook/react-native/pull/53942 Test Plan: N/A Reviewed By: cortinico Differential Revision: D83342637 Pulled By: javache fbshipit-source-id: 556618dd43861b3d3f1728c089f790815f2f011b --- packages/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts b/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts index a2b6d65e028..c0fe6608d45 100644 --- a/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts +++ b/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts @@ -373,7 +373,7 @@ export type GradientValue = { direction?: string | undefined; colorStops: ReadonlyArray<{ color: ColorValue | null; - positions?: ReadonlyArray | undefined; + positions?: ReadonlyArray | undefined; }>; };