Repository navigation
fix(touchable-ripple): fall back to the default ripple for a PlatformColor rippleColor on Android - #5332
Merged
Conversation
React Native 0.85 and older throw "Unexpected color given for Ripple color" from Pressable when android_ripple gets a color that processColor doesn't turn into a number, such as a PlatformColor from DynamicLightTheme or DynamicDarkTheme. On those versions TouchableRipple now gives the native ripple the theme's pressed state layer instead, or no color when that one can't be used either. React Native 0.86 and later take a PlatformColor ripple color, so it is passed through unchanged there. Fixes #5328
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 2 new findings on d31aa2d. The verdict and the full list are in the summary comment.
A caller's own background={{ color }} skipped the ripple color check, so
a PlatformColor there still threw "Unexpected color given for Ripple
color" on React Native 0.85 and older, also through Button, Chip and the
other components that pass background on. Its color now gets the same
check as rippleColor: when it can be used, the background is passed
through as it is; otherwise it is copied with Paper's default ripple
color, keeping borderless, foreground and radius.
Apex Sentinel · ✅ Approve · review of
|
| Finding | Fixed by | Where |
|---|---|---|
PlatformColor in a caller's own background still red-screens on RN ≤ 0.85 |
Doberjohn | 76a856e · reply |
1 finding below minor hidden (user_settings.min_severity).
1 new finding away from what changed since d31aa2d not shown. Comment @apex-sentinel-staging review for a full review.
Reviewed with this repository's own Sentinel configuration (1d9b7f43be12).
💬 Talking to Sentinel
In a finding's thread, reply with:
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
lukewalczak
approved these changes
Nov 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
On Android with React Native 0.85 or older, a
TouchableRipplewith aPlatformColorrippleColororbackgroundcolor (such as aDynamicLightThemecolor on Android 12+) red-screens with "Unexpected color given for Ripple color". It now falls back to the default ripple there. React Native 0.86+ takes aPlatformColorripple (react/react-native#56395), so it's kept.Related issue
Fixes #5328
Screenshots / Videos
Android 13, React Native 0.88, pressed:
Test plan
Tests cover React Native 0.85 (the example runs 0.88). On Android 12+, press a
TouchableRippleand anIconButtonwithrippleColor={theme.colors.primary}underDynamicLightTheme: the ripple is the primary color.