Files
react-native/Libraries/SurfaceBackedComponent/RCTSurfaceBackedComponentState.mm
T
Paige SunandFacebook GitHub Bot 32fa5d6025 3/n (Easy) Make ComponentKit hosting RN use RCTSurfaceProtocol instead of Paper's RCTSurface
Summary:
Changelog: [iOS][Internal] Refactor: Make ComponentKit hosting ReactNative use RCTSurfaceProtocol instead of Paper's RCTSurface

Replace RCTSurface with id<RCTSurfaceProtocol>, because both RCTFabricSurface and RCTSurface conforms to RCTSurfaceProtocol.

Reviewed By: RSNara

Differential Revision: D35163498

fbshipit-source-id: ba54c9bf5949313cd501bd185975fe96d4770961
2022-03-29 11:52:49 -07:00

27 lines
547 B
Plaintext

/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import "RCTSurfaceBackedComponentState.h"
@implementation RCTSurfaceBackedComponentState
+ (instancetype)newWithSurface:(id<RCTSurfaceProtocol>)surface
{
return [[self alloc] initWithSurface:surface];
}
- (instancetype)initWithSurface:(id<RCTSurfaceProtocol>)surface
{
if (self = [super init]) {
_surface = surface;
}
return self;
}
@end