From eea15e7f56e0a0a84f6c6dff8ae79ee864ef9444 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Van=20der=20Auwermeulen?= Date: Thu, 18 Jun 2026 13:40:26 +0200 Subject: [PATCH 1/6] feat(ios): pref el size --- ios/NewArch/MenuView.mm | 1 + src/NativeModuleSpecs/UIMenuNativeComponent.ts | 3 +++ 2 files changed, 4 insertions(+) diff --git a/ios/NewArch/MenuView.mm b/ios/NewArch/MenuView.mm index a54e619e..d66f4407 100644 --- a/ios/NewArch/MenuView.mm +++ b/ios/NewArch/MenuView.mm @@ -134,6 +134,7 @@ - (void)onOpenMenu { @"image": [NSString stringWithUTF8String:action.image.c_str()], @"imageColor": @(action.imageColor), @"displayInline": @(action.displayInline), + @"preferredElementSize": @(actions.preferredElementSize), @"attributes": @{ @"destructive": @(action.attributes.destructive), @"disabled": @(action.attributes.disabled), diff --git a/src/NativeModuleSpecs/UIMenuNativeComponent.ts b/src/NativeModuleSpecs/UIMenuNativeComponent.ts index fc929a39..82a3a6f7 100644 --- a/src/NativeModuleSpecs/UIMenuNativeComponent.ts +++ b/src/NativeModuleSpecs/UIMenuNativeComponent.ts @@ -13,6 +13,8 @@ import codegenNativeComponent from "react-native/Libraries/Utilities/codegenNati types here, to avoid issues while `pod install` takes place. */ +type PreferredElementSize = 'small' | 'medium' | 'large'; + type SubAction = { id?: string; title: string; @@ -37,6 +39,7 @@ type MenuAction = { image?: string; imageColor?: Int32; displayInline?: boolean; + preferredElementSize?: PreferredElementSize; attributes?: { destructive?: boolean; disabled?: boolean; From 1535421d4bb2105e49109e4fecb447366347230e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Van=20der=20Auwermeulen?= Date: Thu, 18 Jun 2026 13:51:35 +0200 Subject: [PATCH 2/6] feat(ios): default size --- src/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.tsx b/src/index.tsx index a5362981..784b002f 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -23,7 +23,7 @@ function processAction(action: MenuAction): ProcessedMenuAction { const defaultHitslop = { top: 0, left: 0, bottom: 0, right: 0 }; const MenuView = forwardRef( - ({ actions, hitSlop = defaultHitslop, ...props }, ref) => { + ({ actions, preferredElementSize = "large", hitSlop = defaultHitslop, ...props }, ref) => { const processedActions = actions.map((action) => processAction(action), ); @@ -37,6 +37,7 @@ const MenuView = forwardRef( hitSlop={hitSlop} actions={processedActions} actionsHash={hash} + preferredElementSize={preferredElementSize} ref={ref} /> ); From 6be40a1b5608c0a3b80bc83b3e74b1049acbb01f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Van=20der=20Auwermeulen?= Date: Thu, 18 Jun 2026 13:56:13 +0200 Subject: [PATCH 3/6] feat(ios): Ts default instead --- src/NativeModuleSpecs/UIMenuNativeComponent.ts | 4 +++- src/index.tsx | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/NativeModuleSpecs/UIMenuNativeComponent.ts b/src/NativeModuleSpecs/UIMenuNativeComponent.ts index 82a3a6f7..63b98670 100644 --- a/src/NativeModuleSpecs/UIMenuNativeComponent.ts +++ b/src/NativeModuleSpecs/UIMenuNativeComponent.ts @@ -1,9 +1,11 @@ import type { DirectEventHandler, Int32, + WithDefault } from "react-native/Libraries/Types/CodegenTypes"; import type { HostComponent, ViewProps } from "react-native"; import codegenNativeComponent from "react-native/Libraries/Utilities/codegenNativeComponent"; + /* Caution, those below are not just typescript types. Codegen is using them to create the corresponding C++ data types. @@ -39,7 +41,7 @@ type MenuAction = { image?: string; imageColor?: Int32; displayInline?: boolean; - preferredElementSize?: PreferredElementSize; + preferredElementSize?: WithDefault; attributes?: { destructive?: boolean; disabled?: boolean; diff --git a/src/index.tsx b/src/index.tsx index 784b002f..a5362981 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -23,7 +23,7 @@ function processAction(action: MenuAction): ProcessedMenuAction { const defaultHitslop = { top: 0, left: 0, bottom: 0, right: 0 }; const MenuView = forwardRef( - ({ actions, preferredElementSize = "large", hitSlop = defaultHitslop, ...props }, ref) => { + ({ actions, hitSlop = defaultHitslop, ...props }, ref) => { const processedActions = actions.map((action) => processAction(action), ); @@ -37,7 +37,6 @@ const MenuView = forwardRef( hitSlop={hitSlop} actions={processedActions} actionsHash={hash} - preferredElementSize={preferredElementSize} ref={ref} /> ); From d4ef0eb3953723ea5eef959352bf1e85af9daa17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Van=20der=20Auwermeulen?= Date: Thu, 18 Jun 2026 14:37:12 +0200 Subject: [PATCH 4/6] feat(ios): action(s) --- ios/NewArch/MenuView.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/NewArch/MenuView.mm b/ios/NewArch/MenuView.mm index d66f4407..ac3de68d 100644 --- a/ios/NewArch/MenuView.mm +++ b/ios/NewArch/MenuView.mm @@ -134,7 +134,7 @@ - (void)onOpenMenu { @"image": [NSString stringWithUTF8String:action.image.c_str()], @"imageColor": @(action.imageColor), @"displayInline": @(action.displayInline), - @"preferredElementSize": @(actions.preferredElementSize), + @"preferredElementSize": @(action.preferredElementSize), @"attributes": @{ @"destructive": @(action.attributes.destructive), @"disabled": @(action.attributes.disabled), From f6eff0c23cd2e45ac9dd3ca6f41ddba1b038a2ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Van=20der=20Auwermeulen?= Date: Thu, 18 Jun 2026 14:48:37 +0200 Subject: [PATCH 5/6] feat(ios): codegen not working with enum --- src/NativeModuleSpecs/UIMenuNativeComponent.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/NativeModuleSpecs/UIMenuNativeComponent.ts b/src/NativeModuleSpecs/UIMenuNativeComponent.ts index 63b98670..e065a154 100644 --- a/src/NativeModuleSpecs/UIMenuNativeComponent.ts +++ b/src/NativeModuleSpecs/UIMenuNativeComponent.ts @@ -15,8 +15,6 @@ import codegenNativeComponent from "react-native/Libraries/Utilities/codegenNati types here, to avoid issues while `pod install` takes place. */ -type PreferredElementSize = 'small' | 'medium' | 'large'; - type SubAction = { id?: string; title: string; @@ -41,7 +39,7 @@ type MenuAction = { image?: string; imageColor?: Int32; displayInline?: boolean; - preferredElementSize?: WithDefault; + preferredElementSize?: WithDefault; attributes?: { destructive?: boolean; disabled?: boolean; From ab08a6c6fe8fd704a23de3f795e41d3302fb13bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Van=20der=20Auwermeulen?= Date: Thu, 18 Jun 2026 14:57:52 +0200 Subject: [PATCH 6/6] feat(ios): cast --- ios/NewArch/MenuView.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/NewArch/MenuView.mm b/ios/NewArch/MenuView.mm index ac3de68d..0550f46a 100644 --- a/ios/NewArch/MenuView.mm +++ b/ios/NewArch/MenuView.mm @@ -134,7 +134,7 @@ - (void)onOpenMenu { @"image": [NSString stringWithUTF8String:action.image.c_str()], @"imageColor": @(action.imageColor), @"displayInline": @(action.displayInline), - @"preferredElementSize": @(action.preferredElementSize), + @"preferredElementSize": [NSString stringWithUTF8String:action.preferredElementSize.c_str()], @"attributes": @{ @"destructive": @(action.attributes.destructive), @"disabled": @(action.attributes.disabled),