Skip to content

Commit 62e1d06

Browse files
Drop RCT_EXPORT_METHOD from RCTDevMenu TurboModule
Summary: Changelog: [Internal] `RCTDevMenu` is a TurboModule: it conforms to `NativeDevMenuSpec` and implements `getTurboModule:` returning the codegen'd `...SpecJSI`. For TurboModules, the JS->ObjC dispatch is driven by codegen (the generated spec supplies the `selector` and argument kinds, invoked at runtime via `NSMethodSignature` / `NSInvocation`), not by the `RCT_EXPORT_METHOD` macro's `__rct_export__` metadata. The exported methods here are async-void with concrete parameter types (no generic `id` requiring `RCTConvert` coercion), so the macro is not functionally required. Convert them to plain ObjC method declarations; conformance to the codegen'd `NativeDevMenuSpec` protocol keeps compiler-enforced signature parity. Signature-only refactor with no change to the JS-facing API. Sync methods, methods with `id` params, and `constantsToExport` are intentionally left untouched. Differential Revision: D113579872
1 parent f9226a1 commit 62e1d06

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

packages/react-native/React/CoreModules/RCTDevMenu.mm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ - (void)setDefaultJSBundle
430430
return items;
431431
}
432432

433-
RCT_EXPORT_METHOD(show)
433+
- (void)show
434434
{
435435
if ((_actionSheet != nullptr) || RCTRunningInAppExtension() || !_devMenuEnabled) {
436436
return;
@@ -495,13 +495,13 @@ - (BOOL)shakeToShow
495495
return ((RCTDevSettings *)[_moduleRegistry moduleForName:"DevSettings"]).isShakeToShowDevMenuEnabled;
496496
}
497497

498-
RCT_EXPORT_METHOD(reload)
498+
- (void)reload
499499
{
500500
WARN_DEPRECATED_DEV_MENU_EXPORT();
501501
RCTTriggerReloadCommandListeners(@"Unknown from JS");
502502
}
503503

504-
RCT_EXPORT_METHOD(setProfilingEnabled : (BOOL)enabled)
504+
- (void)setProfilingEnabled:(BOOL)enabled
505505
{
506506
WARN_DEPRECATED_DEV_MENU_EXPORT();
507507
((RCTDevSettings *)[_moduleRegistry moduleForName:"DevSettings"]).isProfilingEnabled = enabled;
@@ -512,7 +512,7 @@ - (BOOL)profilingEnabled
512512
return ((RCTDevSettings *)[_moduleRegistry moduleForName:"DevSettings"]).isProfilingEnabled;
513513
}
514514

515-
RCT_EXPORT_METHOD(setHotLoadingEnabled : (BOOL)enabled)
515+
- (void)setHotLoadingEnabled:(BOOL)enabled
516516
{
517517
WARN_DEPRECATED_DEV_MENU_EXPORT();
518518
((RCTDevSettings *)[_moduleRegistry moduleForName:"DevSettings"]).isHotLoadingEnabled = enabled;

0 commit comments

Comments
 (0)