mirror of
https://github.com/status-im/react-native.git
synced 2025-02-08 15:45:23 +00:00
15cb6540c1
Summary: Note: not all scrollview props and features (especially event listeners and imperative calls) are supported yet. Reviewed By: fkgozali Differential Revision: D7961868 fbshipit-source-id: 5277674fe976e089fd963066f78e705ad846d78d
43 lines
1.1 KiB
Plaintext
43 lines
1.1 KiB
Plaintext
/**
|
|
* 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 "RCTViewComponentView.h"
|
|
|
|
#import <fabric/view/ViewProps.h>
|
|
|
|
using namespace facebook::react;
|
|
|
|
@implementation RCTViewComponentView
|
|
|
|
- (void)updateProps:(facebook::react::SharedProps)props
|
|
oldProps:(facebook::react::SharedProps)oldProps
|
|
{
|
|
if (!oldProps) {
|
|
oldProps = _props ?: std::make_shared<ViewProps>();
|
|
}
|
|
_props = props;
|
|
|
|
auto oldViewProps = *std::dynamic_pointer_cast<const ViewProps>(oldProps);
|
|
auto newViewProps = *std::dynamic_pointer_cast<const ViewProps>(props);
|
|
|
|
if (oldViewProps.backgroundColor != newViewProps.backgroundColor) {
|
|
self.backgroundColor = [UIColor colorWithCGColor:newViewProps.backgroundColor.get()];
|
|
}
|
|
|
|
// TODO: Implement all sutable non-layout <View> props.
|
|
}
|
|
|
|
- (void)updateLayoutMetrics:(LayoutMetrics)layoutMetrics
|
|
oldLayoutMetrics:(LayoutMetrics)oldLayoutMetrics
|
|
{
|
|
[super updateLayoutMetrics:layoutMetrics oldLayoutMetrics:oldLayoutMetrics];
|
|
|
|
_layoutMetrics = layoutMetrics;
|
|
}
|
|
|
|
@end
|