Files
react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h
Valentin Shergin 8fa2d847b6 Fabric: -[RCTViewComponentView setContentView:]:
Summary:
This is just the convenient way to embed native views inside custom View components.
See coming <Switch> implementation as an example.

Reviewed By: fkgozali

Differential Revision: D8344056

fbshipit-source-id: 7f5f8cfeeffa7676bc7b562aa07f006cb9006575
2018-06-15 11:47:39 -07:00

42 lines
1.2 KiB
Objective-C

/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import <UIKit/UIKit.h>
#import <React/RCTComponentViewProtocol.h>
#import <React/UIView+ComponentViewProtocol.h>
#import <fabric/core/EventEmitter.h>
#import <fabric/core/LayoutMetrics.h>
#import <fabric/core/Props.h>
#import <fabric/view/ViewEventEmitter.h>
NS_ASSUME_NONNULL_BEGIN
/**
* UIView class for <View> component.
*/
@interface RCTViewComponentView : UIView <RCTComponentViewProtocol> {
@protected
facebook::react::LayoutMetrics _layoutMetrics;
facebook::react::SharedProps _props;
facebook::react::SharedViewEventEmitter _eventEmitter;
}
/**
* Represents the `UIView` instance that is being automatically attached to
* the component view and laid out using on `layoutMetrics` (especially `size`
* and `padding`) of the component.
* This view must not be a component view; it's just a convenient way
* to embed/bridge pure native views as component views.
* Defaults to `nil`. Assing `nil` to remove view as subview.
*/
@property (nonatomic, strong, nullable) UIView *contentView;
@end
NS_ASSUME_NONNULL_END