Skip to content

fix(ios): mirror menuElementOrder in the SwiftPM header - #1261

Merged
Naturalclar merged 1 commit into
masterfrom
fix/spm-header-menu-element-order
Nov 22, 2026
Merged

Naturalclar merged 1 commit into
masterfrom
fix/spm-header-menu-element-order

Conversation

@Naturalclar

Copy link
Copy Markdown
Member

Problem

master is red since #1259: the SwiftPM package job fails with

headers: FabricViewImplementationProtocol.menuElementOrder is not mirrored in spm-headers/react_native_menu-Swift.h

#1259 added an optional menuElementOrder member to FabricViewImplementationProtocol, and ios/NewArch/MenuView.mm sets _view.menuElementOrder. SwiftPM builds compile MenuView.mm against the hand-kept spm-headers/react_native_menu-Swift.h, not Xcode's generated header, so without this declaration that line doesn't compile under SwiftPM. #1259's CI ran before #1257 added the check, so it wasn't caught there.

Fix

Declare it in the header's @optional section, next to hitSlop. It matches the Swift @objc optional var menuElementOrder: NSString? and follows the existing themeVariant declaration.

Verification

node scripts/check-spm.mjs passes locally: "SwiftPM package checks passed." Before this change it failed with the error above.

🤖 Generated with Claude Code

#1259 added an optional `menuElementOrder` member to
FabricViewImplementationProtocol, but SwiftPM builds read the hand-kept
spm-headers/react_native_menu-Swift.h, which did not declare it. Without
it, MenuView.mm's `_view.menuElementOrder` does not compile under SwiftPM.
scripts/check-spm.mjs caught this on master; #1259's CI predated that check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Naturalclar
Naturalclar merged commit cbb3b75 into master Nov 22, 2026
6 checks passed
@Naturalclar
Naturalclar deleted the fix/spm-header-menu-element-order branch November 22, 2026 05:52
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.

1 participant