diff --git a/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm b/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm index 7752feffbaddc1..94ace4e996c200 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm +++ b/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm @@ -93,8 +93,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( RCTSurfaceHostingProxyRootView *surfaceHostingProxyRootView = [[RCTSurfaceHostingProxyRootView alloc] initWithSurface:surface - sizeMeasureMode:RCTSurfaceSizeMeasureModeWidthExact | RCTSurfaceSizeMeasureModeHeightExact - moduleRegistry:[_reactHost getModuleRegistry]]; + sizeMeasureMode:RCTSurfaceSizeMeasureModeWidthExact | RCTSurfaceSizeMeasureModeHeightExact]; rootView = (RCTRootView *)surfaceHostingProxyRootView; #endif diff --git a/packages/react-native/React/Base/RCTRootView.h b/packages/react-native/React/Base/RCTRootView.h index 08113e91d343eb..2903273639d0af 100644 --- a/packages/react-native/React/Base/RCTRootView.h +++ b/packages/react-native/React/Base/RCTRootView.h @@ -77,14 +77,6 @@ extern initialProperties:(nullable NSDictionary *)initialProperties launchOptions:(nullable NSDictionary *)launchOptions; -/** - * This API allows users of RCTRootView to access other NativeModules, without - * directly accessing the bridge. - */ -@property (nonatomic, strong, readonly) RCTModuleRegistry *moduleRegistry; - -@property (nonatomic, strong, readonly) id eventDispatcher; - /** * The name of the JavaScript module to execute within the * specified scriptURL (required). Setting this will not have diff --git a/packages/react-native/React/Base/RCTRootView.m b/packages/react-native/React/Base/RCTRootView.m index 113f44dc27ebda..c7c142075bbc6a 100644 --- a/packages/react-native/React/Base/RCTRootView.m +++ b/packages/react-native/React/Base/RCTRootView.m @@ -121,16 +121,6 @@ - (UIView *)view return self; } -- (RCTModuleRegistry *)moduleRegistry -{ - return _bridge.moduleRegistry; -} - -- (id)eventDispatcher -{ - return [self.moduleRegistry moduleForName:"EventDispatcher"]; -} - #pragma mark - passThroughTouches - (BOOL)passThroughTouches diff --git a/packages/react-native/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.h b/packages/react-native/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.h index c11084908cc2ca..02092dd0449f44 100644 --- a/packages/react-native/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.h +++ b/packages/react-native/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.h @@ -27,8 +27,6 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, copy, readonly) NSString *moduleName; @property (nonatomic, strong, readonly) RCTBridge *bridge; -@property (nonatomic, strong, readonly) RCTModuleRegistry *moduleRegistry; -@property (nonatomic, strong, readonly) id eventDispatcher; @property (nonatomic, copy, readwrite) NSDictionary *appProperties; @property (nonatomic, assign) RCTRootViewSizeFlexibility sizeFlexibility; @property (nonatomic, weak) id delegate; @@ -41,14 +39,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, assign) NSTimeInterval loadingViewFadeDuration; @property (nonatomic, assign) CGSize minimumSize; -/** - * Bridgeless mode initializer - */ -- (instancetype)initWithSurface:(id)surface - sizeMeasureMode:(RCTSurfaceSizeMeasureMode)sizeMeasureMode - moduleRegistry:(RCTModuleRegistry *)moduleRegistry; - -- (instancetype)initWithSurface:(id)surface; +- (instancetype)initWithSurface:(id)surface NS_DESIGNATED_INITIALIZER; - (void)cancelTouches; diff --git a/packages/react-native/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm b/packages/react-native/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm index c5b7ed2777096e..670c02299601ec 100644 --- a/packages/react-native/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm +++ b/packages/react-native/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm @@ -49,20 +49,7 @@ static RCTRootViewSizeFlexibility convertToRootViewSizeFlexibility(RCTSurfaceSiz } } -@implementation RCTSurfaceHostingProxyRootView { - RCTModuleRegistry *_moduleRegistry; -} - -- (instancetype)initWithSurface:(id)surface - sizeMeasureMode:(RCTSurfaceSizeMeasureMode)sizeMeasureMode - moduleRegistry:(RCTModuleRegistry *)moduleRegistry -{ - if (self = [super initWithSurface:surface sizeMeasureMode:sizeMeasureMode]) { - _moduleRegistry = moduleRegistry; - } - - return self; -} +@implementation RCTSurfaceHostingProxyRootView - (instancetype)initWithSurface:(id)surface { @@ -73,21 +60,6 @@ - (instancetype)initWithSurface:(id)surface return self; } -- (RCTModuleRegistry *)moduleRegistry -{ - // In bridgeless mode, RCTSurfaceHostingProxyRootView is created with an RCTModuleRegistry - if (_moduleRegistry) { - return _moduleRegistry; - } - - return _bridge.moduleRegistry; -} - -- (id)eventDispatcher -{ - return [self.moduleRegistry moduleForName:"EventDispatcher"]; -} - RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame) RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder)