Skip to content

Commit

Permalink
iOS: proxy minimumSize to RCTSurface, but as a noop
Browse files Browse the repository at this point in the history
Summary:
Previously, RCTRootView added support for minimumSize as a workaround for some initial layout use cases. Going forward, we don't need this anymore. So let's add a proxy property but log an error if anyone calls it.

Changelog: [iOS][Changed] - Proxy minimumSize to RCTSurface as a noop

Reviewed By: JoshuaGross

Differential Revision: D29284227

fbshipit-source-id: 98b2dfc905c6c7e1adc03216e3a1cc3fda0a4133
  • Loading branch information
fkgozali authored and facebook-github-bot committed Jun 22, 2021
1 parent fc9c326 commit fb58fa1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, assign) BOOL passThroughTouches;
@property (nonatomic, assign) NSTimeInterval loadingViewFadeDelay;
@property (nonatomic, assign) NSTimeInterval loadingViewFadeDuration;
@property (nonatomic, assign) CGSize minimumSize;

- (instancetype)initWithBridge:(RCTBridge *)bridge
moduleName:(NSString *)moduleName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ - (instancetype)initWithBridge:(RCTBridge *)bridge
RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, @"-[RCTSurfaceHostingProxyRootView init]", nil);

_bridge = bridge;
_minimumSize = CGSizeZero;

if (!bridge.isLoading) {
[bridge.performanceLogger markStartForTag:RCTPLTTI];
Expand Down Expand Up @@ -172,6 +173,15 @@ - (UIViewController *)reactViewController
return _reactViewController ?: [super reactViewController];
}

- (void)setMinimumSize:(CGSize)minimumSize
{
if (!CGSizeEqualToSize(minimumSize, CGSizeZero)) {
// TODO (T93859532): Investigate implementation for this.
RCTLogError(@"RCTSurfaceHostingProxyRootView does not support changing the deprecated minimumSize");
}
_minimumSize = CGSizeZero;
}

#pragma mark unsupported

- (void)cancelTouches
Expand Down

0 comments on commit fb58fa1

Please sign in to comment.