Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion ios/Shared/RCTMenuItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,14 @@ class RCTMenuAction {
if self.image === nil {
self.image = UIImage(named: image as String)
}
if let imageColor = details["imageColor"] {
// Under React Native's New Architecture, the codegen-generated
// MenuViewActionsSubactionsStruct declares `int imageColor{0}` as
// the default, so the bridge always forwards a value even when JS
// didn't pass one. Without this guard the unwrap below would
// succeed with `imageColor == 0`, and `RCTConvert.uiColor(0)`
// returns a fully transparent UIColor — every SF Symbol passed
// via `image` would render invisible. Closes #1198, refs #1034 #1002.
if let imageColor = details["imageColor"], (imageColor as? Int) != 0 {
self.image = self.image?.withTintColor(RCTConvert.uiColor(imageColor), renderingMode: .alwaysOriginal)
}
}
Expand Down