Skip to content

Commit 83b1975

Browse files
motiz88facebook-github-bot
authored andcommitted
Extend ColorValue Flow type to include numbers
Summary: Adds `number` to the `ColorValue` union type. Per our docs, React Native supports specifying colours as RGBA values packed into ints: https://reactnative.dev/docs/colors#color-ints. It looks like this case was missed in D6226807 (da04796) when we started typing the `StyleSheet` API with Flow. Changelog: [General][Fixed] - Support numeric color values in StyleSheet's Flow types Reviewed By: yungsters Differential Revision: D34140748 fbshipit-source-id: 5bfe2995a473260926fa3c8b6926bb841615d393
1 parent 89c3aac commit 83b1975

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Libraries/StyleSheet/StyleSheetTypes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const AnimatedNode = require('../Animated/nodes/AnimatedNode');
1414

1515
import type {NativeColorValue} from './PlatformColorValueTypes';
1616

17-
export type ____ColorValue_Internal = null | string | NativeColorValue;
17+
export type ____ColorValue_Internal = null | string | number | NativeColorValue;
1818

1919
export type ColorArrayValue = null | $ReadOnlyArray<____ColorValue_Internal>;
2020
export type PointValue = {|

0 commit comments

Comments
 (0)