Skip to content

fix(types): widen color props to ColorValue (#5179) - #5193

Open
EnesKartal wants to merge 1 commit into
callstack:mainfrom
EnesKartal:fix-color-props-colorvalue
Open

EnesKartal wants to merge 1 commit into
callstack:mainfrom
EnesKartal:fix-color-props-colorvalue

Conversation

@EnesKartal

Copy link
Copy Markdown

Summary

Fixes #5179

In 6.x, theme color roles are typed ColorValue (allowing platform-specific dynamic colors like PlatformColor on Android with DynamicLightTheme/DynamicDarkTheme). However, several component color props were still typed as string, causing TypeScript compilation errors (TS2322: Type 'ColorValue' is not assignable to type 'string | undefined') when passing theme colors or platform colors to them.

This PR updates the remaining color props across Paper components to accept ColorValue:

  • ProgressBar: color?: ColorValue
  • Appbar.Content: color?: ColorValue
  • Avatar.Icon, Avatar.Text: color?: ColorValue
  • TouchableRipple: underlayColor?: ColorValue
  • BottomNavigation, BottomNavigation.Bar: activeColor?: ColorValue, inactiveColor?: ColorValue
  • SegmentedButtons (and each item): checkedColor?: ColorValue, uncheckedColor?: ColorValue
  • RadioButton, RadioButton.Item, RadioButtonAndroid, RadioButtonIOS: color?: ColorValue, uncheckedColor?: ColorValue
  • Checkbox.Item: color?: ColorValue, uncheckedColor?: ColorValue

Test plan

  • Added src/components/__tests__/ColorProps.test.tsx verifying that every updated component accepts and renders with a ColorValue prop without type or runtime errors.
  • TypeScript project typecheck passed: npm run typecheck (tsc -b).
  • Unit tests passed: npm test src/components/__tests__/ColorProps.test.tsx.
  • ESLint passed: npx eslint ....

Copilot AI balanced review requested due to automatic review settings November 8, 2026 09:37
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

Found potential problems with the pull request:

  • The description is too long. Please keep it under 1000 characters.
  • Screenshot or video evidence is missing. Make sure to include one if it affects the UI.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Color props typed string reject theme colors, which are ColorValue in 6.x

2 participants