wix / react-native-ui-lib

UI Components Library for React Native
https://wix.github.io/react-native-ui-lib/
MIT License
6.59k stars 717 forks source link

Color Style props should be typed as ColorValue, not string #3202

Open sn-cuong opened 3 months ago

sn-cuong commented 3 months ago

Description

Currently in components such as Button and TouchableOpacity, the activeBackgroundColor and backgroundColor among other props used for setting the color of a visual UI element should be typed as the ColorValue type from react-native. Currently, they are typed as string types.

Related to

Steps to reproduce

  1. Pass a ColorValue typed prop used for styling UI elements into activeBackgroundColor.

Expected behavior

Actual behavior

See type error Type 'ColorValue' is not assignable to type 'string | undefined'.

More Info

Screenshots/Video

Screenshot 2024-08-07 at 6 38 16 PM

Environment

Affected platforms