Open History to see the last commit
1diff --git a/ios/MenuViewManager.mm b/ios/MenuViewManager.mm
2index 3d149b3e7426b8f7c999603ddf1e15e12331c33a..e80fe2caae86e339fcb03408419a7d64b3e5b04f 100644
3--- a/ios/MenuViewManager.mm
4+++ b/ios/MenuViewManager.mm
5@@ -65,6 +65,10 @@ - (UIView *)view
6 * onOpenMenu: callback to be called when the menu is opened
7 */
8 RCT_EXPORT_VIEW_PROPERTY(onOpenMenu, RCTDirectEventBlock);
9+/**
10+ * onMenuInteractionStart: callback to be called when UIKit starts preparing a menu interaction
11+ */
12+RCT_EXPORT_VIEW_PROPERTY(onMenuInteractionStart, RCTDirectEventBlock);
13 /**
14 * shouldOpenOnLongPress: determines whether menu should be opened after long press or normal press
15 */
16diff --git a/ios/NewArch/FabricActionSheetView.swift b/ios/NewArch/FabricActionSheetView.swift
17index 484ff8a1d73a6d445273883c5b28b1c8e80901ec..bc92310d00369b853a80f4d2080578f3903191d2 100644
18--- a/ios/NewArch/FabricActionSheetView.swift
19+++ b/ios/NewArch/FabricActionSheetView.swift
20@@ -3,6 +3,7 @@ public class FabricActionSheetView: ActionSheetView, FabricViewImplementationPro
21 public var onPressAction: ((String) -> Void)?
22 public var onCloseMenu: (() -> Void)?
23 public var onOpenMenu: (() -> Void)?
24+ public var onMenuInteractionStart: (() -> Void)?
26 @objc override func sendButtonAction(_ action: String) {
27 if let onPress = onPressAction {
28diff --git a/ios/NewArch/FabricMenuViewImplementation.swift b/ios/NewArch/FabricMenuViewImplementation.swift
29index 33d27c5a66593ae1a9b143804413578eb79f1a7d..359cd19fa53d10c0374b2b537517ea8629e79d0c 100644
30--- a/ios/NewArch/FabricMenuViewImplementation.swift
31+++ b/ios/NewArch/FabricMenuViewImplementation.swift
32@@ -12,6 +12,7 @@ public class FabricMenuViewImplementation: MenuViewImplementation, FabricViewImp
33 public var onPressAction: ((String) -> Void)?
34 public var onCloseMenu: (() -> Void)?
35 public var onOpenMenu: (() -> Void)?
36+ public var onMenuInteractionStart: (() -> Void)?
38 @objc override func sendButtonAction(_ action: UIAction) {
39 if let onPress = onPressAction {
40@@ -31,4 +32,10 @@ public class FabricMenuViewImplementation: MenuViewImplementation, FabricViewImp
41 }
42 }
44+ @objc override func sendMenuInteractionStart() {
45+ if let onMenuInteractionStart = onMenuInteractionStart {
46+ onMenuInteractionStart()
47+ }
48+ }
49+
50 }
51diff --git a/ios/NewArch/FabricViewImplementationProtocol.swift b/ios/NewArch/FabricViewImplementationProtocol.swift
52index 2cef2fb8c74497da46775a490edc58cf8cbf29cc..54429c756eeecf6e96b55d62cc1e70213096f62a 100644
53--- a/ios/NewArch/FabricViewImplementationProtocol.swift
54+++ b/ios/NewArch/FabricViewImplementationProtocol.swift
55@@ -8,4 +8,5 @@ import Foundation
56 var onPressAction: ((String) -> Void)? { get set }
57 var onCloseMenu: (() -> Void)? { get set }
58 var onOpenMenu: (() -> Void)? { get set }
59+ var onMenuInteractionStart: (() -> Void)? { get set }
60 }
61diff --git a/ios/NewArch/MenuView.mm b/ios/NewArch/MenuView.mm
62index a54e619eb39e3402fa63f2ee4f734063d4f8fc58..773f6f1f5d4e0663fd3211fe51085a7f3935e445 100644
63--- a/ios/NewArch/MenuView.mm
64+++ b/ios/NewArch/MenuView.mm
65@@ -46,6 +46,10 @@ - (instancetype)initWithFrame:(CGRect)frame
66 [self onOpenMenu];
67 };
69+ _view.onMenuInteractionStart = ^{
70+ [self onMenuInteractionStart];
71+ };
72+
73 _view.onCloseMenu = ^{
74 [self onCloseMenu];
75 };
76@@ -92,6 +96,14 @@ - (void)onOpenMenu {
77 }
78 }
80+- (void)onMenuInteractionStart {
81+ // If screen is already unmounted then there will be no event emitter
82+ const auto eventEmitter = [self getEventEmitter];
83+ if (eventEmitter != nullptr) {
84+ eventEmitter->onMenuInteractionStart({});
85+ }
86+}
87+
88 /**
89 Responsible for iterating through the C++ vector<struct> and convert each struct element to NSDictionary, then return it all in an NSArray
90 */
91@@ -105,6 +117,27 @@ - (void)onOpenMenu {
92 NSMutableArray<NSDictionary *> *subactionsArray = [NSMutableArray arrayWithCapacity:actions.size()];
93 if (action.subactions.size() > 0) {
94 for (const MenuViewActionsSubactionsStruct &subaction : action.subactions) {
95+ NSMutableArray<NSDictionary *> *subSubactionsArray =
96+ [NSMutableArray arrayWithCapacity:subaction.subactions.size()];
97+ for (const MenuViewActionsSubactionsSubactionsStruct &subSubaction : subaction.subactions) {
98+ NSDictionary *subSubactionDict = @{
99+ @"id": [NSString stringWithUTF8String:subSubaction.id.c_str()],
100+ @"title": [NSString stringWithUTF8String:subSubaction.title.c_str()],
101+ @"titleColor": @(subSubaction.titleColor),
102+ @"subtitle": [NSString stringWithUTF8String:subSubaction.subtitle.c_str()],
103+ @"state": [NSString stringWithUTF8String:subSubaction.state.c_str()],
104+ @"image": [NSString stringWithUTF8String:subSubaction.image.c_str()],
105+ @"imageColor": @(subSubaction.imageColor),
106+ @"displayInline": @(subSubaction.displayInline),
107+ @"attributes": @{
108+ @"destructive": @(subSubaction.attributes.destructive),
109+ @"disabled": @(subSubaction.attributes.disabled),
110+ @"hidden": @(subSubaction.attributes.hidden),
111+ @"keepsMenuPresented": @(subSubaction.attributes.keepsMenuPresented),
112+ },
113+ };
114+ [subSubactionsArray addObject:subSubactionDict];
115+ }
116 NSDictionary *subactionDict = @{
117 @"id": [NSString stringWithUTF8String:subaction.id.c_str()],
118 @"title": [NSString stringWithUTF8String:subaction.title.c_str()],
119@@ -118,7 +151,9 @@ - (void)onOpenMenu {
120 @"destructive": @(subaction.attributes.destructive),
121 @"disabled": @(subaction.attributes.disabled),
122 @"hidden": @(subaction.attributes.hidden),
123+ @"keepsMenuPresented": @(subaction.attributes.keepsMenuPresented),
124 },
125+ @"subactions": subSubactionsArray,
126 };
127 [subactionsArray addObject:subactionDict];
128 }
129@@ -138,6 +173,7 @@ - (void)onOpenMenu {
130 @"destructive": @(action.attributes.destructive),
131 @"disabled": @(action.attributes.disabled),
132 @"hidden": @(action.attributes.hidden),
133+ @"keepsMenuPresented": @(action.attributes.keepsMenuPresented),
134 },
135 @"subactions": subactionsArray,
136 };
137diff --git a/ios/OldArch/LegacyActionSheetView.swift b/ios/OldArch/LegacyActionSheetView.swift
138index 3cd1a2517624d99b51331c564fba9145d7c8d799..e458504bea6ef167d9b0db0c889f0f76ea965287 100644
139--- a/ios/OldArch/LegacyActionSheetView.swift
140+++ b/ios/OldArch/LegacyActionSheetView.swift
141@@ -3,6 +3,7 @@ public class LegacyActionSheetView: ActionSheetView {
142 @objc var onPressAction: RCTDirectEventBlock?
143 @objc var onCloseMenu: RCTDirectEventBlock?
144 @objc var onOpenMenu: RCTDirectEventBlock?
145+ @objc var onMenuInteractionStart: RCTDirectEventBlock?
149diff --git a/ios/OldArch/LegacyMenuViewImplementation.swift b/ios/OldArch/LegacyMenuViewImplementation.swift
150index 6a2a205f95c1001f3fdf6fb835815fa7c4c02c16..4f42b64349966fb1438f72439cec8256a76aab9c 100644
151--- a/ios/OldArch/LegacyMenuViewImplementation.swift
152+++ b/ios/OldArch/LegacyMenuViewImplementation.swift
153@@ -5,6 +5,7 @@ public class LegacyMenuViewImplementation: MenuViewImplementation {
154 @objc var onPressAction: RCTDirectEventBlock?
155 @objc var onCloseMenu: RCTDirectEventBlock?
156 @objc var onOpenMenu: RCTDirectEventBlock?
157+ @objc var onMenuInteractionStart: RCTDirectEventBlock?
159 @objc override func sendButtonAction(_ action: UIAction) {
160 if let onPress = onPressAction {
161@@ -24,4 +25,10 @@ public class LegacyMenuViewImplementation: MenuViewImplementation {
162 }
163 }
165+ @objc override func sendMenuInteractionStart() {
166+ if let onMenuInteractionStart = onMenuInteractionStart {
167+ onMenuInteractionStart([:])
168+ }
169+ }
170+
171 }
172diff --git a/ios/Shared/MenuViewImplementation.swift b/ios/Shared/MenuViewImplementation.swift
173index 5c4e0da4292b15d3a27b5ea1555f11452a470815..4d8abe3c4fc45bda48c2958bc9ca933c77f2cc47 100644
174--- a/ios/Shared/MenuViewImplementation.swift
175+++ b/ios/Shared/MenuViewImplementation.swift
176@@ -60,17 +60,46 @@ public class MenuViewImplementation: UIButton {
177 }
179 public override func contextMenuInteraction(_ interaction: UIContextMenuInteraction, configurationForMenuAtLocation location: CGPoint) -> UIContextMenuConfiguration? {
180- sendMenuOpen()
181+ // Flush updates deferred by the presented-guard before the action
182+ // provider snapshots self.menu (covers a stuck flag from an
183+ // interaction that never ended cleanly).
184+ if pendingMenu != nil {
185+ pendingMenu = nil
186+ isMenuPresented = false
187+ self.setup()
188+ }
189+ isMenuPresented = true
190+ sendMenuInteractionStart()
191 return UIContextMenuConfiguration(identifier: nil, previewProvider: nil) { [weak self] _ in
192 guard let self = self else { return nil }
193 return self.menu
194 }
195 }
196-
197+
198+ public override func contextMenuInteraction(_ interaction: UIContextMenuInteraction, willDisplayMenuFor configuration: UIContextMenuConfiguration, animator: UIContextMenuInteractionAnimating?) {
199+ // UIKit can request a configuration for a press that never opens a
200+ // menu. Notify React only once presentation actually begins, and
201+ // preserve UIButton's presentation behavior by calling super.
202+ super.contextMenuInteraction(interaction, willDisplayMenuFor: configuration, animator: animator)
203+ sendMenuOpen()
204+ }
205+
206 public override func contextMenuInteraction(_ interaction: UIContextMenuInteraction, willEndFor configuration: UIContextMenuConfiguration, animator: UIContextMenuInteractionAnimating?) {
207+ super.contextMenuInteraction(interaction, willEndFor: configuration, animator: animator)
208 sendMenuClose()
209+ isMenuPresented = false
210+ if pendingMenu != nil {
211+ // Re-run the full assignment now that presentation is over, so
212+ // any props deferred by the presented-guard (menu contents, press
213+ // mode) land on the button.
214+ pendingMenu = nil
215+ self.setup()
216+ }
217 }
219+ private var isMenuPresented = false
220+ private var pendingMenu: UIMenu?
221+
222 func setup () {
223 let menu = UIMenu(title: _title,
224 identifier: nil,
225@@ -86,8 +115,98 @@ public class MenuViewImplementation: UIButton {
226 }
227 }
229+ if isMenuPresented {
230+ // An action fired with keepsMenuPresented leaves the menu on
231+ // screen, and reassigning self.menu while it is presented makes
232+ // UIKit dismiss it — the update triggered by a selection would
233+ // defeat the keep-presented attribute. Update the visible copy in
234+ // place instead and defer the button assignment to dismissal.
235+ pendingMenu = menu
236+ self.refreshPresentedMenu(menu)
237+ return
238+ }
239+
240 self.menu = menu
241 self.showsMenuAsPrimaryAction = !shouldOpenOnLongPress
242+ // In long-press mode the button must not intercept touches: as a
243+ // full-bounds contentView it sits IN FRONT of the React children of
244+ // the hosting component view, which would swallow their taps (e.g. a
245+ // row Pressable wrapped by MenuView). The context-menu interaction is
246+ // hosted by the superview instead (see updateLongPressInteraction) so
247+ // long-press and pointer secondary-click still present the menu, with
248+ // the wrapped content as the zoom preview.
249+ self.isUserInteractionEnabled = !shouldOpenOnLongPress
250+ self.updateLongPressInteraction()
251+ }
252+
253+ private func refreshPresentedMenu(_ menu: UIMenu) {
254+ // Tap mode presents through the button's built-in interaction,
255+ // long-press mode through the superview-hosted one; cover both (plus
256+ // the interaction added in init) and dedupe by identity.
257+ var candidates = self.interactions.compactMap { $0 as? UIContextMenuInteraction }
258+ if let builtin = self.contextMenuInteraction {
259+ candidates.append(builtin)
260+ }
261+ if let host = longPressInteraction {
262+ candidates.append(host)
263+ }
264+ var visited: Set<ObjectIdentifier> = []
265+ for interaction in candidates where visited.insert(ObjectIdentifier(interaction)).inserted {
266+ // The block receives whichever menu level is currently on screen —
267+ // the navigated submenu when the user picked inside one, not the
268+ // root. Swap in the matching node from the rebuilt tree (stable
269+ // identifiers from the JS action ids) so that level updates in
270+ // place; returning an unrelated menu instead makes UIKit render it
271+ // as navigation into a foreign menu, with a stale or blank
272+ // expanded-submenu header row above the actions. The root carries
273+ // an auto-generated identifier that never matches, so it falls
274+ // through to a children-only replacement.
275+ interaction.updateVisibleMenu { [weak self] visibleMenu in
276+ guard let self = self else { return visibleMenu }
277+ if let replacement = self.menuMatching(visibleMenu.identifier, in: menu) {
278+ return replacement
279+ }
280+ return visibleMenu.replacingChildren(menu.children)
281+ }
282+ }
283+ }
284+
285+ private func menuMatching(_ identifier: UIMenu.Identifier, in menu: UIMenu) -> UIMenu? {
286+ if menu.identifier == identifier {
287+ return menu
288+ }
289+ for element in menu.children {
290+ if let submenu = element as? UIMenu, let match = menuMatching(identifier, in: submenu) {
291+ return match
292+ }
293+ }
294+ return nil
295+ }
296+
297+ private var longPressInteraction: UIContextMenuInteraction?
298+
299+ public override func didMoveToSuperview() {
300+ super.didMoveToSuperview()
301+ self.updateLongPressInteraction()
302+ }
303+
304+ private func updateLongPressInteraction() {
305+ if shouldOpenOnLongPress, let host = self.superview {
306+ if let existing = longPressInteraction, existing.view === host {
307+ return
308+ }
309+ if let existing = longPressInteraction {
310+ existing.view?.removeInteraction(existing)
311+ }
312+ let interaction = UIContextMenuInteraction(delegate: self)
313+ host.addInteraction(interaction)
314+ longPressInteraction = interaction
315+ return
316+ }
317+ if let existing = longPressInteraction {
318+ existing.view?.removeInteraction(existing)
319+ longPressInteraction = nil
320+ }
321 }
323 public override func reactSetFrame(_ frame: CGRect) {
324@@ -124,4 +243,8 @@ public class MenuViewImplementation: UIButton {
325 @objc func sendMenuOpen() {
326 // NO-OP (should be overriden by parent)
327 }
328+
329+ @objc func sendMenuInteractionStart() {
330+ // NO-OP (should be overriden by parent)
331+ }
332 }
333diff --git a/ios/Shared/RCTMenuItem.swift b/ios/Shared/RCTMenuItem.swift
334index bb6bb2b7ad56135089f267587c974b166760539d..949b3f7ec49af7ba26d966a8923a51f619443d5a 100644
335--- a/ios/Shared/RCTMenuItem.swift
336+++ b/ios/Shared/RCTMenuItem.swift
337@@ -103,10 +103,18 @@ class RCTMenuAction {
338 subMenuActions.append(subaction.createUIMenuElement(handler))
339 }
340 var menu: UIMenu;
341+ // Stable identifiers let updateVisibleMenu match submenu nodes in
342+ // place, so a refresh while the menu is presented keeps the user's
343+ // current submenu level instead of popping back to the root.
344+ // Inline sections don't navigate, so they stay stock.
345+ let menuIdentifier = identifier.map { UIMenu.Identifier(rawValue: $0.rawValue) }
346 if self.displayInline {
347 menu = UIMenu(title: title, image: image, options: .displayInline, children: subMenuActions)
348 } else {
349- menu = UIMenu(title: title, image: image, children: subMenuActions)
350+ menu = UIMenu(title: title, image: image, identifier: menuIdentifier, children: subMenuActions)
351+ }
352+ if #available(iOS 15.0, *) {
353+ menu.subtitle = subtitle
354 }
356 if #available(iOS 16.0, *) {
357diff --git a/lib/commonjs/NativeModuleSpecs/UIMenuNativeComponent.ts b/lib/commonjs/NativeModuleSpecs/UIMenuNativeComponent.ts
358index e6509355275596c451f9d082223cc16bfe504e1a..dd16e1a7403970cc3a404355f95ed99580776353 100644
359--- a/lib/commonjs/NativeModuleSpecs/UIMenuNativeComponent.ts
360+++ b/lib/commonjs/NativeModuleSpecs/UIMenuNativeComponent.ts
361@@ -48,6 +48,7 @@ export interface NativeProps extends ViewProps {
362 onPressAction?: DirectEventHandler<{ event: string }>;
363 onCloseMenu?: DirectEventHandler<{ event: string }>;
364 onOpenMenu?: DirectEventHandler<{ event: string }>;
365+ onMenuInteractionStart?: DirectEventHandler<{ event: string }>;
366 actions: Array<MenuAction>;
367 actionsHash: string; // just a workaround to make sure we don't have to manually compare MenuActions manually in C++ (since it's a struct and that's a pain)
368 title?: string;
369diff --git a/lib/module/NativeModuleSpecs/UIMenuNativeComponent.ts b/lib/module/NativeModuleSpecs/UIMenuNativeComponent.ts
370index e6509355275596c451f9d082223cc16bfe504e1a..dd16e1a7403970cc3a404355f95ed99580776353 100644
371--- a/lib/module/NativeModuleSpecs/UIMenuNativeComponent.ts
372+++ b/lib/module/NativeModuleSpecs/UIMenuNativeComponent.ts
373@@ -48,6 +48,7 @@ export interface NativeProps extends ViewProps {
374 onPressAction?: DirectEventHandler<{ event: string }>;
375 onCloseMenu?: DirectEventHandler<{ event: string }>;
376 onOpenMenu?: DirectEventHandler<{ event: string }>;
377+ onMenuInteractionStart?: DirectEventHandler<{ event: string }>;
378 actions: Array<MenuAction>;
379 actionsHash: string; // just a workaround to make sure we don't have to manually compare MenuActions manually in C++ (since it's a struct and that's a pain)
380 title?: string;
381diff --git a/lib/typescript/src/NativeModuleSpecs/UIMenuNativeComponent.d.ts b/lib/typescript/src/NativeModuleSpecs/UIMenuNativeComponent.d.ts
382index 24ee7fdcd9f81cfe2c813cfca9d4e276b846fb7b..5ee7b45bafea8547d68949aaba70584055f9fb53 100644
383--- a/lib/typescript/src/NativeModuleSpecs/UIMenuNativeComponent.d.ts
384+++ b/lib/typescript/src/NativeModuleSpecs/UIMenuNativeComponent.d.ts
385@@ -41,6 +41,9 @@ export interface NativeProps extends ViewProps {
386 onOpenMenu?: DirectEventHandler<{
387 event: string;
388 }>;
389+ onMenuInteractionStart?: DirectEventHandler<{
390+ event: string;
391+ }>;
392 actions: Array<MenuAction>;
393 actionsHash: string;
394 title?: string;
395diff --git a/lib/typescript/src/index.d.ts b/lib/typescript/src/index.d.ts
396index 61d210aa9364f0354f77bddaecdc0a127b1cdbb4..84ac2bc8b4edac045ed59896d5eb4e6eaef4725d 100644
397--- a/lib/typescript/src/index.d.ts
398+++ b/lib/typescript/src/index.d.ts
399@@ -4,6 +4,7 @@ declare const MenuView: import("react").ForwardRefExoticComponent<{
400 onPressAction?: ({ nativeEvent }: NativeActionEvent) => void;
401 onCloseMenu?: () => void;
402 onOpenMenu?: () => void;
403+ onMenuInteractionStart?: () => void;
404 actions: MenuAction[];
405 title?: string;
406 isAnchoredToRight?: boolean;
407diff --git a/lib/typescript/src/types.d.ts b/lib/typescript/src/types.d.ts
408index eac7940ab7eb6a69ac329848c9f3eeffdcbaf43d..271cd27f777be06bc02f05d4b4dac5bb940f5f0f 100644
409--- a/lib/typescript/src/types.d.ts
410+++ b/lib/typescript/src/types.d.ts
411@@ -113,6 +113,12 @@ type MenuComponentPropsBase = {
412 * Callback function that will be called when the menu opens.
413 */
414 onOpenMenu?: () => void;
415+ /**
416+ * Callback function that will be called when UIKit starts preparing a menu interaction.
417+ * Preparation can end without the menu opening.
418+ * @platform iOS
419+ */
420+ onMenuInteractionStart?: () => void;
421 /**
422 * Actions to be displayed in the menu.
423 */
424@@ -170,6 +176,7 @@ export type NativeMenuComponentProps = {
425 onPressAction?: ({ nativeEvent }: NativeActionEvent) => void;
426 onCloseMenu?: () => void;
427 onOpenMenu?: () => void;
428+ onMenuInteractionStart?: () => void;
429 actions: ProcessedMenuAction[];
430 actionsHash: string;
431 title?: string;
432diff --git a/src/NativeModuleSpecs/UIMenuNativeComponent.ts b/src/NativeModuleSpecs/UIMenuNativeComponent.ts
433index e6509355275596c451f9d082223cc16bfe504e1a..604dba0d90a2545910f8724a80205565de2391d4 100644
434--- a/src/NativeModuleSpecs/UIMenuNativeComponent.ts
435+++ b/src/NativeModuleSpecs/UIMenuNativeComponent.ts
436@@ -13,6 +13,22 @@ import codegenNativeComponent from "react-native/Libraries/Utilities/codegenNati
437 types here, to avoid issues while `pod install` takes place.
438 */
440+type SubSubAction = {
441+ id?: string;
442+ title: string;
443+ titleColor?: Int32;
444+ subtitle?: string;
445+ state?: string;
446+ image?: string;
447+ imageColor?: Int32;
448+ displayInline?: boolean;
449+ attributes?: {
450+ destructive?: boolean;
451+ disabled?: boolean;
452+ hidden?: boolean;
453+ keepsMenuPresented?: boolean;
454+ };
455+};
456 type SubAction = {
457 id?: string;
458 title: string;
459@@ -26,7 +42,11 @@ type SubAction = {
460 destructive?: boolean;
461 disabled?: boolean;
462 hidden?: boolean;
463+ keepsMenuPresented?: boolean;
464 };
465+ // One extra nesting level (menu → submenu → nested submenu leaves); the
466+ // codegen structs can't recurse, so depth is capped explicitly.
467+ subactions?: Array<SubSubAction>;
468 };
469 type MenuAction = {
470 id?: string;
471@@ -41,6 +61,7 @@ type MenuAction = {
472 destructive?: boolean;
473 disabled?: boolean;
474 hidden?: boolean;
475+ keepsMenuPresented?: boolean;
476 };
477 subactions?: Array<SubAction>;
478 };
479@@ -48,6 +69,7 @@ export interface NativeProps extends ViewProps {
480 onPressAction?: DirectEventHandler<{ event: string }>;
481 onCloseMenu?: DirectEventHandler<{ event: string }>;
482 onOpenMenu?: DirectEventHandler<{ event: string }>;
483+ onMenuInteractionStart?: DirectEventHandler<{ event: string }>;
484 actions: Array<MenuAction>;
485 actionsHash: string; // just a workaround to make sure we don't have to manually compare MenuActions manually in C++ (since it's a struct and that's a pain)
486 title?: string;
487diff --git a/src/types.ts b/src/types.ts
488index 9c323d9c510e7359c83d4d6633affde673570632..5d5fdfb8b8235fcaa8295b85630443eaf5991a17 100644
489--- a/src/types.ts
490+++ b/src/types.ts
491@@ -123,6 +123,12 @@ type MenuComponentPropsBase = {
492 * Callback function that will be called when the menu opens.
493 */
494 onOpenMenu?: () => void;
495+ /**
496+ * Callback function that will be called when UIKit starts preparing a menu interaction.
497+ * Preparation can end without the menu opening.
498+ * @platform iOS
499+ */
500+ onMenuInteractionStart?: () => void;
501 /**
502 * Actions to be displayed in the menu.
503 */
504@@ -189,6 +195,7 @@ export type NativeMenuComponentProps = {
505 onPressAction?: ({ nativeEvent }: NativeActionEvent) => void;
506 onCloseMenu?: () => void;
507 onOpenMenu?: () => void;
508+ onMenuInteractionStart?: () => void;
509 actions: ProcessedMenuAction[];
510 actionsHash: string;
511 title?: string;