From 2f6c4a43bd10ee0017a49a461c925d7bc120e455 Mon Sep 17 00:00:00 2001 From: Christoph Purrer Date: Thu, 22 Oct 2026 20:20:16 -0700 Subject: [PATCH] Remove write-only bridge from sample legacy modules (#59261) Summary: Pull Request resolved: https://github.com/react/react-native/pull/59261 RCTSampleLegacyModule on iOS and macOS stored a bridge that nothing reads. Delete the ivar and setter from both sample files. Changelog: [Internal] Reviewed By: shwanton Differential Revision: D126575656 fbshipit-source-id: 24554aa151537a14afd4f57ef8de5b5e465933c4 --- .../platform/ios/ReactCommon/RCTSampleLegacyModule.mm | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/packages/react-native/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleLegacyModule.mm b/packages/react-native/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleLegacyModule.mm index f6788d1db74..c283f6d7f6a 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleLegacyModule.mm +++ b/packages/react-native/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleLegacyModule.mm @@ -7,9 +7,7 @@ #import "RCTSampleLegacyModule.h" -@implementation RCTSampleLegacyModule { - RCTBridge *_bridge; -} +@implementation RCTSampleLegacyModule // Backward-compatible export RCT_EXPORT_MODULE() @@ -20,11 +18,6 @@ RCT_EXPORT_MODULE() return YES; } -- (void)setBridge:(RCTBridge *)bridge -{ - _bridge = bridge; -} - - (dispatch_queue_t)methodQueue { return dispatch_get_main_queue();