fix(ios): skip imageColor tint when New-Arch defaults it to 0#1200
Open
smsfnxbtww-rgb wants to merge 1 commit into
Open
fix(ios): skip imageColor tint when New-Arch defaults it to 0#1200smsfnxbtww-rgb wants to merge 1 commit into
smsfnxbtww-rgb wants to merge 1 commit into
Conversation
Under React Native's New Architecture the codegen-generated
MenuViewActionsSubactionsStruct declares `int imageColor{0}` as
the default. The iOS bridge unconditionally forwards it, so the
Swift unwrap `if let imageColor = details["imageColor"]` always
succeeds — and `RCTConvert.uiColor(0)` returns a fully transparent
UIColor. Result: every SF Symbol passed via `image` renders
invisible on iOS 26 + New Arch.
This guard checks the int value and skips the tint when it's the
default (0). When the JS side explicitly passes imageColor: 0,
the result is unchanged (transparent tint), so no observable
regression for that case.
Closes react-native-menu#1198. Refs react-native-menu#1034, react-native-menu#1002.
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.
Problem
Under React Native's New Architecture the codegen-generated
MenuViewActionsSubactionsStructdeclaresint imageColor{0}asthe default. The iOS new-arch bridge unconditionally forwards
imageColorto the Swift layer even when JS didn't pass one. TheSwift unwrap in
ios/Shared/RCTMenuItem.swift—if let imageColor = details["imageColor"] { … }— thereforealways succeeds, and
RCTConvert.uiColor(0)returns a fullytransparent
UIColor. Every SF Symbol passed viaimageends uptinted with
rgba(0,0,0,0)— invisible.Reproduction
Any Expo SDK 55 / RN 0.83 app with New Arch enabled (the default)
on iOS 26+ that passes
imagewithoutimageColor:Result: row reads "Share" with empty space where the symbol should
be.
Fix
Gate the tint on
(imageColor as? Int) != 0. When the JS sidedidn't pass
imageColor, the New-Arch default of 0 is detectedand the tint is skipped — UIKit's automatic tinting takes over,
matching pre-bug behavior.
When the JS side explicitly passes
imageColor: 0, the symbol isstill tinted with
RCTConvert.uiColor(0)(transparent), same asbefore. No behavior change for that case.
Confirmation
Verified end-to-end in a production app (Expo SDK 55 / RN 0.83 /
iOS 26.5 / iPhone 17 Pro Simulator) by applying the same diff as a
local
patch-packagepatch. With the patch applied, every menu'sSF Symbols render correctly across the entire app (Compose FAB,
FilterMenu, DetailHeaderMenu, every detail-screen
…menu,PublishActionBar, admin list
+ New/Filtermenus).The change is a one-line guard plus an inline comment explaining the
root cause; no test changes are included because the library
currently has no Swift-side unit tests for
RCTMenuAction.initthat would exercise the bridge path. Happy to add one if maintainers
point at a preferred test location.
Related
Closes #1198. Refs #1034, #1002.