react-native/Libraries/SurfaceBackedComponent/RCTSurfaceBackedComponentState.mm
Valentin Shergin aa83b5a0ca Introducing RCTSurfaceBackedComponent
Summary:
RCTSurfaceBackedComponent is ComponentKit component represents a React Native Surface created
(and stored in the state) with given `bridge`, `moduleName`, and `properties`.

Differential Revision: D6217103

fbshipit-source-id: 2849f68e1975562cd47851bda232e389705b4229
2017-11-11 21:25:47 -08:00

31 lines
677 B
Plaintext

/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import "RCTSurfaceBackedComponentState.h"
#import <React/RCTSurface.h>
@implementation RCTSurfaceBackedComponentState
+ (instancetype)newWithSurface:(RCTSurface *)surface
{
return [[self alloc] initWithSurface:surface];
}
- (instancetype)initWithSurface:(RCTSurface *)surface
{
if (self == [super init]) {
_surface = surface;
}
return self;
}
@end