mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-07 09:27:29 +08:00
Summary: The new method in the protocol enforces view component classes to expose a component handle of the component that the view component represents. That will allow us to wire up those classes with shadow views in runtime explicitly and in a much more performant way than it is now. Reviewed By: mdvacca Differential Revision: D13114663 fbshipit-source-id: 853187d978aab200f85719d9c1d9fea2e3ad4e55
33 lines
684 B
Plaintext
33 lines
684 B
Plaintext
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#import "RCTRootComponentView.h"
|
|
|
|
#import <react/components/root/RootShadowNode.h>
|
|
#import <react/components/root/RootProps.h>
|
|
|
|
using namespace facebook::react;
|
|
|
|
@implementation RCTRootComponentView
|
|
|
|
- (instancetype)initWithFrame:(CGRect)frame
|
|
{
|
|
if (self = [super initWithFrame:frame]) {
|
|
static const auto defaultProps = std::make_shared<const RootProps>();
|
|
_props = defaultProps;
|
|
}
|
|
|
|
return self;
|
|
}
|
|
|
|
+ (ComponentHandle)componentHandle
|
|
{
|
|
return RootShadowNode::Handle();
|
|
}
|
|
|
|
@end
|