Skip to content

Commit

Permalink
remove RCTSurfaceSizeMeasureMode from public contract of RCTSurfaceHo…
Browse files Browse the repository at this point in the history
…stingProxyRootView (#38866)

Summary:
Pull Request resolved: #38866

## Changelog:

[iOS][Breaking] - Remove sizeMeasureMode argument from RCTSurfaceHostingProxyRootView constructor

All callsites to `initWithSurface:sizeMeasureMode:moduleRegistry` pass down `RCTSurfaceSizeMeasureModeWidthExact | RCTSurfaceSizeMeasureModeHeightExact`. since that's the case, let's simplify the constructor since `initWithSurface:` passes that value by default.

Reviewed By: sammy-SC, cipolleschi

Differential Revision: D48140102

fbshipit-source-id: c3240ad4c1e650397844837e4a071ff7bd26ee15
  • Loading branch information
philIip authored and facebook-github-bot committed Aug 17, 2023
1 parent 65b7680 commit 0d83c1a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
6 changes: 2 additions & 4 deletions packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
RCTFabricSurface *surface = [_reactHost createSurfaceWithModuleName:self.moduleName
initialProperties:launchOptions];

RCTSurfaceHostingProxyRootView *surfaceHostingProxyRootView = [[RCTSurfaceHostingProxyRootView alloc]
initWithSurface:surface
sizeMeasureMode:RCTSurfaceSizeMeasureModeWidthExact | RCTSurfaceSizeMeasureModeHeightExact
moduleRegistry:[_reactHost getModuleRegistry]];
RCTSurfaceHostingProxyRootView *surfaceHostingProxyRootView =
[[RCTSurfaceHostingProxyRootView alloc] initWithSurface:surface moduleRegistry:[_reactHost getModuleRegistry]];

rootView = (RCTRootView *)surfaceHostingProxyRootView;
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
* Bridgeless mode initializer
*/
- (instancetype)initWithSurface:(id<RCTSurfaceProtocol>)surface
sizeMeasureMode:(RCTSurfaceSizeMeasureMode)sizeMeasureMode
moduleRegistry:(RCTModuleRegistry *)moduleRegistry;
- (instancetype)initWithSurface:(id<RCTSurfaceProtocol>)surface moduleRegistry:(RCTModuleRegistry *)moduleRegistry;

- (instancetype)initWithSurface:(id<RCTSurfaceProtocol>)surface;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,9 @@ - (instancetype)initWithBundleURL:(NSURL *)bundleURL
return [self initWithBridge:bridge moduleName:moduleName initialProperties:initialProperties];
}

- (instancetype)initWithSurface:(id<RCTSurfaceProtocol>)surface
sizeMeasureMode:(RCTSurfaceSizeMeasureMode)sizeMeasureMode
moduleRegistry:(RCTModuleRegistry *)moduleRegistry
- (instancetype)initWithSurface:(id<RCTSurfaceProtocol>)surface moduleRegistry:(RCTModuleRegistry *)moduleRegistry
{
if (self = [super initWithSurface:surface sizeMeasureMode:sizeMeasureMode]) {
if (self = [self initWithSurface:surface]) {
_moduleRegistry = moduleRegistry;
}

Expand Down

0 comments on commit 0d83c1a

Please sign in to comment.