Skip to content

Commit f7ea40b

Browse files
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: #53942 Test Plan: N/A Reviewed By: cortinico Differential Revision: D83342637 Pulled By: javache fbshipit-source-id: 556618dd43861b3d3f1728c089f790815f2f011b
1 parent ad5949f commit f7ea40b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ export type GradientValue = {
373373
direction?: string | undefined;
374374
colorStops: ReadonlyArray<{
375375
color: ColorValue | null;
376-
positions?: ReadonlyArray<string[]> | undefined;
376+
positions?: ReadonlyArray<string> | undefined;
377377
}>;
378378
};
379379

0 commit comments

Comments
 (0)