Repository navigation
Take any colour in the color prop of RNTester's legacy native view on Android, as iOS does - #59230
Open
YevheniiKotyrlo wants to merge 3 commits into
Open
YevheniiKotyrlo wants to merge 3 commits into
YevheniiKotyrlo wants to merge 3 commits into
Conversation
Contributor
Author
YevheniiKotyrlo
marked this pull request as ready for review
October 20, 2026 14:47
YevheniiKotyrlo
marked this pull request as draft
October 20, 2026 16:20
RNTester's example set no color on the legacy view, so no e2e job reached the setter. A "Set Color Prop" button gives the view rgb(255, 255, 255), and new-arch-examples.yml asserts the HSBA the view reports back, which reads h: 0, s: 0, b: 1, a: 255 on both platforms.
…tons step through theirs
YevheniiKotyrlo
marked this pull request as ready for review
October 21, 2026 12:02
This branch has not been deployed
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.







Summary:
RNTester's legacy native view takes a
colorprop that iOS declares aUIColor(RNTMyLegacyNativeViewManager.mm), so the view config runsprocessColoron it.MyLegacyViewManageron Android takes it as aStringand parses it withColor.parseColor, which reads Android's colour grammar rather than React Native's:rgb(),hsl()and most named colours throwIllegalArgumentException: Unknown colorfrom the prop setter and end the app, an eight-digit hex is read as#AARRGGBBinstead of CSS's#RRGGBBAA, and aPlatformColorcan't be passed.This declares the setter
@ReactProp(customType = "Color")with anInt?, as ReactAndroid's own colour props do, soprocessColorruns on Android too, and types the propColorValue. The view's commands keep taking a#RRGGBBstring, the one form both platforms read alike and the one RNTester passes them.RNTester's example set no
coloron the legacy view, so nothing reached the setter. Its new "Set Color Prop" button steps the view throughrgb(255, 255, 255),hsl(240, 100%, 50%)andsteelblue, andnew-arch-examples.ymlasserts the colour the view reports back after the first press,h: 0, s: 0, b: 1, a: 255on both platforms, so the e2e jobs cover the prop.Changelog:
[INTERNAL] [FIXED] - Take any colour in the color prop of RNTester's legacy native view on Android, as iOS does
Test Plan:
On a Galaxy S23 (Android 14), with RNTester release builds under an application id of their own:
View'sbackgroundColorand as the legacy view'scolor, side by side, onmainand with this change: onmain,rgb(70, 130, 180)ends the app on launch (Unknown colorfromMyLegacyViewManager.setColor) and#4682B480draws#ddeadcbeside theView's#a2c0d9; with this change every row — hex,rgb(),hsl(),steelblueand aPlatformColor— matches theViewbeside it. Screenshots and the crash are in the comment below.maestro test -e APP_ID=com.facebook.react.uiapp.rn470 packages/rn-tester/.maestro/new-arch-examples.yml: passes with this change. With the example and flow changes overmain'sMyLegacyViewManager, tapping "Set Color Prop" ends the app (Error while updating property 'color' of a view managed by: RNTMyLegacyNativeView) and the flow fails at the new assertion.On an iPad Pro 12.9-inch (4th generation), iOS 27.0.1, with an RNTester release build of this change:
HSBA: h: 0, s: 0, b: 1, a: 255after "Set Color Prop", as the flow asserts, andh: 240, s: 1, b: 1, a: 255after a second press. Maestro needs a simulator on iOS, which I don't have, so CI's iOS e2e job is the first run of the flow itself there.And in the Android CI image:
./gradlew :packages:rn-tester:android:app:assembleRelease -PreactNativeArchitectures=arm64-v8a -PenableWarningsAsErrors=true:BUILD SUCCESSFUL.yarn flow-check:Found 0 errors.yarn eslint --max-warnings 0andyarn prettier --checkon the changed JavaScript and YAML files, andyarn format-check-kotlin: no findings.