diff --git a/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.mm index ffa0203cb..d6270063b 100644 --- a/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.mm @@ -7,12 +7,13 @@ #import "RCTActivityIndicatorViewComponentView.h" -#import #import +#import using namespace facebook::react; -static UIActivityIndicatorViewStyle convertActivityIndicatorViewStyle(const ActivityIndicatorViewSize &size) { +static UIActivityIndicatorViewStyle convertActivityIndicatorViewStyle(const ActivityIndicatorViewSize &size) +{ switch (size) { case ActivityIndicatorViewSize::Small: return UIActivityIndicatorViewStyleWhite; diff --git a/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.h b/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.h index 3fd08c2bd..716edc910 100644 --- a/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.h +++ b/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.h @@ -5,8 +5,8 @@ * LICENSE file in the root directory of this source tree. */ -#import "RCTViewComponentView.h" #import +#import "RCTViewComponentView.h" NS_ASSUME_NONNULL_BEGIN diff --git a/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm b/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm index b3ec1a834..0174d94a0 100644 --- a/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm @@ -7,16 +7,16 @@ #import "RCTImageComponentView.h" +#import #import #import #import #import #import #import -#import -#import "RCTConversions.h" #import "MainQueueExecutor.h" +#import "RCTConversions.h" @implementation RCTImageComponentView { UIImageView *_imageView; @@ -35,7 +35,7 @@ _imageView.clipsToBounds = YES; _imageView.contentMode = (UIViewContentMode)RCTResizeModeFromImageResizeMode(defaultProps->resizeMode); - + _imageResponseObserverProxy = std::make_unique((__bridge void *)self); self.contentView = _imageView; @@ -75,24 +75,24 @@ } } -- (void)updateLocalData:(SharedLocalData)localData - oldLocalData:(SharedLocalData)oldLocalData +- (void)updateLocalData:(SharedLocalData)localData oldLocalData:(SharedLocalData)oldLocalData { SharedImageLocalData previousData = _imageLocalData; _imageLocalData = std::static_pointer_cast(localData); assert(_imageLocalData); bool havePreviousData = previousData != nullptr; - + if (!havePreviousData || _imageLocalData->getImageSource() != previousData->getImageSource()) { self.coordinator = _imageLocalData->getImageRequest().getObserverCoordinator(); - + // Loading actually starts a little before this, but this is the first time we know // the image is loading and can fire an event from this component std::static_pointer_cast(_eventEmitter)->onLoadStart(); } } -- (void)setCoordinator:(const ImageResponseObserverCoordinator *)coordinator { +- (void)setCoordinator:(const ImageResponseObserverCoordinator *)coordinator +{ if (_coordinator) { _coordinator->removeObserver(_imageResponseObserverProxy.get()); } @@ -110,7 +110,7 @@ _imageLocalData.reset(); } --(void)dealloc +- (void)dealloc { self.coordinator = nullptr; _imageResponseObserverProxy.reset(); @@ -118,7 +118,7 @@ #pragma mark - RCTImageResponseDelegate -- (void)didReceiveImage:(UIImage *)image fromObserver:(void*)observer +- (void)didReceiveImage:(UIImage *)image fromObserver:(void *)observer { std::static_pointer_cast(_eventEmitter)->onLoad(); @@ -138,7 +138,7 @@ } self->_imageView.image = image; - + // Apply trilinear filtering to smooth out mis-sized images. self->_imageView.layer.minificationFilter = kCAFilterTrilinear; self->_imageView.layer.magnificationFilter = kCAFilterTrilinear; @@ -146,13 +146,14 @@ std::static_pointer_cast(self->_eventEmitter)->onLoadEnd(); } -- (void)didReceiveProgress:(float)progress fromObserver:(void*)observer { +- (void)didReceiveProgress:(float)progress fromObserver:(void *)observer +{ std::static_pointer_cast(_eventEmitter)->onProgress(progress); } -- (void)didReceiveFailureFromObserver:(void*)observer { +- (void)didReceiveFailureFromObserver:(void *)observer +{ std::static_pointer_cast(_eventEmitter)->onError(); } - @end diff --git a/React/Fabric/Mounting/ComponentViews/Root/RCTRootComponentView.mm b/React/Fabric/Mounting/ComponentViews/Root/RCTRootComponentView.mm index d5e7b3be8..ebfd680c2 100644 --- a/React/Fabric/Mounting/ComponentViews/Root/RCTRootComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/Root/RCTRootComponentView.mm @@ -7,8 +7,8 @@ #import "RCTRootComponentView.h" -#import #import +#import using namespace facebook::react; diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm index f92ca42a8..a788f2f7b 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm @@ -8,10 +8,10 @@ #import "RCTScrollViewComponentView.h" #import -#import +#import #import #import -#import +#import #import #import "RCTConversions.h" @@ -63,9 +63,9 @@ using namespace facebook::react; [super updateProps:props oldProps:oldProps]; -#define REMAP_PROP(reactName, localName, target) \ +#define REMAP_PROP(reactName, localName, target) \ if (oldScrollViewProps.reactName != newScrollViewProps.reactName) { \ - target.localName = newScrollViewProps.reactName; \ + target.localName = newScrollViewProps.reactName; \ } #define REMAP_VIEW_PROP(reactName, localName) REMAP_PROP(reactName, localName, self) @@ -80,11 +80,11 @@ using namespace facebook::react; MAP_SCROLL_VIEW_PROP(bouncesZoom); MAP_SCROLL_VIEW_PROP(canCancelContentTouches); MAP_SCROLL_VIEW_PROP(centerContent); - //MAP_SCROLL_VIEW_PROP(automaticallyAdjustContentInsets); + // MAP_SCROLL_VIEW_PROP(automaticallyAdjustContentInsets); MAP_SCROLL_VIEW_PROP(decelerationRate); MAP_SCROLL_VIEW_PROP(directionalLockEnabled); - //MAP_SCROLL_VIEW_PROP(indicatorStyle); - //MAP_SCROLL_VIEW_PROP(keyboardDismissMode); + // MAP_SCROLL_VIEW_PROP(indicatorStyle); + // MAP_SCROLL_VIEW_PROP(keyboardDismissMode); MAP_SCROLL_VIEW_PROP(maximumZoomScale); MAP_SCROLL_VIEW_PROP(minimumZoomScale); MAP_SCROLL_VIEW_PROP(scrollEnabled); @@ -95,30 +95,27 @@ using namespace facebook::react; MAP_SCROLL_VIEW_PROP(showsVerticalScrollIndicator); MAP_VIEW_PROP(scrollEventThrottle); MAP_SCROLL_VIEW_PROP(zoomScale); - //MAP_SCROLL_VIEW_PROP(contentInset); - //MAP_SCROLL_VIEW_PROP(scrollIndicatorInsets); - //MAP_SCROLL_VIEW_PROP(snapToInterval); - //MAP_SCROLL_VIEW_PROP(snapToAlignment); + // MAP_SCROLL_VIEW_PROP(contentInset); + // MAP_SCROLL_VIEW_PROP(scrollIndicatorInsets); + // MAP_SCROLL_VIEW_PROP(snapToInterval); + // MAP_SCROLL_VIEW_PROP(snapToAlignment); } -- (void)updateLocalData:(SharedLocalData)localData - oldLocalData:(SharedLocalData)oldLocalData +- (void)updateLocalData:(SharedLocalData)localData oldLocalData:(SharedLocalData)oldLocalData { assert(std::dynamic_pointer_cast(localData)); _scrollViewLocalData = std::static_pointer_cast(localData); CGSize contentSize = RCTCGSizeFromSize(_scrollViewLocalData->getContentSize()); - _contentView.frame = CGRect {CGPointZero, contentSize}; + _contentView.frame = CGRect{CGPointZero, contentSize}; _scrollView.contentSize = contentSize; } -- (void)mountChildComponentView:(UIView *)childComponentView - index:(NSInteger)index +- (void)mountChildComponentView:(UIView *)childComponentView index:(NSInteger)index { [_contentView insertSubview:childComponentView atIndex:index]; } -- (void)unmountChildComponentView:(UIView *)childComponentView - index:(NSInteger)index +- (void)unmountChildComponentView:(UIView *)childComponentView index:(NSInteger)index { RCTAssert(childComponentView.superview == _contentView, @"Attempt to unmount improperly mounted component view."); [childComponentView removeFromSuperview]; @@ -152,14 +149,17 @@ using namespace facebook::react; std::static_pointer_cast(_eventEmitter)->onScrollBeginDrag([self _scrollViewMetrics]); } -- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset +- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView + withVelocity:(CGPoint)velocity + targetContentOffset:(inout CGPoint *)targetContentOffset { std::static_pointer_cast(_eventEmitter)->onScrollEndDrag([self _scrollViewMetrics]); } - (void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView { - std::static_pointer_cast(_eventEmitter)->onMomentumScrollBegin([self _scrollViewMetrics]); + std::static_pointer_cast(_eventEmitter) + ->onMomentumScrollBegin([self _scrollViewMetrics]); } - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView diff --git a/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.mm b/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.mm index ccdef3d96..8b90f3b44 100644 --- a/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.mm @@ -7,11 +7,11 @@ #import "RCTSliderComponentView.h" +#import #import +#import #import #import -#import -#import #import "MainQueueExecutor.h" @@ -21,12 +21,12 @@ using namespace facebook::react; UISlider *_sliderView; float _previousValue; SharedSliderLocalData _sliderLocalData; - + UIImage *_trackImage; UIImage *_minimumTrackImage; UIImage *_maximumTrackImage; UIImage *_thumbImage; - + const ImageResponseObserverCoordinator *_trackImageCoordinator; const ImageResponseObserverCoordinator *_minimumTrackImageCoordinator; const ImageResponseObserverCoordinator *_maximumTrackImageCoordinator; @@ -38,7 +38,6 @@ using namespace facebook::react; std::unique_ptr _thumbImageResponseObserverProxy; } - - (instancetype)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { @@ -47,14 +46,10 @@ using namespace facebook::react; _sliderView = [[UISlider alloc] initWithFrame:self.bounds]; - [_sliderView addTarget:self - action:@selector(onChange:) - forControlEvents:UIControlEventValueChanged]; + [_sliderView addTarget:self action:@selector(onChange:) forControlEvents:UIControlEventValueChanged]; [_sliderView addTarget:self action:@selector(sliderTouchEnd:) - forControlEvents:(UIControlEventTouchUpInside | - UIControlEventTouchUpOutside | - UIControlEventTouchCancel)]; + forControlEvents:(UIControlEventTouchUpInside | UIControlEventTouchUpOutside | UIControlEventTouchCancel)]; _sliderView.value = defaultProps->value; @@ -74,7 +69,7 @@ using namespace facebook::react; - (void)prepareForRecycle { [super prepareForRecycle]; - + self.trackImageCoordinator = nullptr; self.minimumTrackImageCoordinator = nullptr; self.maximumTrackImageCoordinator = nullptr; @@ -94,7 +89,7 @@ using namespace facebook::react; _thumbImage = nil; } --(void)dealloc +- (void)dealloc { self.trackImageCoordinator = nullptr; self.minimumTrackImageCoordinator = nullptr; @@ -158,21 +153,22 @@ using namespace facebook::react; } } -- (void)updateLocalData:(SharedLocalData)localData - oldLocalData:(SharedLocalData)oldLocalData +- (void)updateLocalData:(SharedLocalData)localData oldLocalData:(SharedLocalData)oldLocalData { SharedSliderLocalData previousData = _sliderLocalData; _sliderLocalData = std::static_pointer_cast(localData); assert(_sliderLocalData); bool havePreviousData = previousData != nullptr; - + if (!havePreviousData || _sliderLocalData->getTrackImageSource() != previousData->getTrackImageSource()) { self.trackImageCoordinator = _sliderLocalData->getTrackImageRequest().getObserverCoordinator(); } - if (!havePreviousData || _sliderLocalData->getMinimumTrackImageSource() != previousData->getMinimumTrackImageSource()) { + if (!havePreviousData || + _sliderLocalData->getMinimumTrackImageSource() != previousData->getMinimumTrackImageSource()) { self.minimumTrackImageCoordinator = _sliderLocalData->getMinimumTrackImageRequest().getObserverCoordinator(); } - if (!havePreviousData || _sliderLocalData->getMaximumTrackImageSource() != previousData->getMaximumTrackImageSource()) { + if (!havePreviousData || + _sliderLocalData->getMaximumTrackImageSource() != previousData->getMaximumTrackImageSource()) { self.maximumTrackImageCoordinator = _sliderLocalData->getMaximumTrackImageRequest().getObserverCoordinator(); } if (!havePreviousData || _sliderLocalData->getThumbImageSource() != previousData->getThumbImageSource()) { @@ -180,7 +176,8 @@ using namespace facebook::react; } } -- (void)setTrackImageCoordinator:(const ImageResponseObserverCoordinator *)coordinator { +- (void)setTrackImageCoordinator:(const ImageResponseObserverCoordinator *)coordinator +{ if (_trackImageCoordinator) { _trackImageCoordinator->removeObserver(_trackImageResponseObserverProxy.get()); } @@ -190,7 +187,8 @@ using namespace facebook::react; } } -- (void)setMinimumTrackImageCoordinator:(const ImageResponseObserverCoordinator *)coordinator { +- (void)setMinimumTrackImageCoordinator:(const ImageResponseObserverCoordinator *)coordinator +{ if (_minimumTrackImageCoordinator) { _minimumTrackImageCoordinator->removeObserver(_minimumTrackImageResponseObserverProxy.get()); } @@ -200,7 +198,8 @@ using namespace facebook::react; } } -- (void)setMaximumTrackImageCoordinator:(const ImageResponseObserverCoordinator *)coordinator { +- (void)setMaximumTrackImageCoordinator:(const ImageResponseObserverCoordinator *)coordinator +{ if (_maximumTrackImageCoordinator) { _maximumTrackImageCoordinator->removeObserver(_maximumTrackImageResponseObserverProxy.get()); } @@ -210,7 +209,8 @@ using namespace facebook::react; } } -- (void)setThumbImageCoordinator:(const ImageResponseObserverCoordinator *)coordinator { +- (void)setThumbImageCoordinator:(const ImageResponseObserverCoordinator *)coordinator +{ if (_thumbImageCoordinator) { _thumbImageCoordinator->removeObserver(_thumbImageResponseObserverProxy.get()); } @@ -220,56 +220,58 @@ using namespace facebook::react; } } -- (void)setTrackImage:(UIImage *)trackImage { +- (void)setTrackImage:(UIImage *)trackImage +{ if ([trackImage isEqual:_trackImage]) { return; } - + _trackImage = trackImage; _minimumTrackImage = nil; _maximumTrackImage = nil; CGFloat width = trackImage.size.width / 2; - UIImage *minimumTrackImage = [trackImage resizableImageWithCapInsets:(UIEdgeInsets){ - 0, width, 0, width - } resizingMode:UIImageResizingModeStretch]; - UIImage *maximumTrackImage = [trackImage resizableImageWithCapInsets:(UIEdgeInsets){ - 0, width, 0, width - } resizingMode:UIImageResizingModeStretch]; + UIImage *minimumTrackImage = [trackImage resizableImageWithCapInsets:(UIEdgeInsets){0, width, 0, width} + resizingMode:UIImageResizingModeStretch]; + UIImage *maximumTrackImage = [trackImage resizableImageWithCapInsets:(UIEdgeInsets){0, width, 0, width} + resizingMode:UIImageResizingModeStretch]; [_sliderView setMinimumTrackImage:minimumTrackImage forState:UIControlStateNormal]; [_sliderView setMaximumTrackImage:maximumTrackImage forState:UIControlStateNormal]; } --(void)setMinimumTrackImage:(UIImage *)minimumTrackImage { +- (void)setMinimumTrackImage:(UIImage *)minimumTrackImage +{ if ([minimumTrackImage isEqual:_minimumTrackImage] && _trackImage == nil) { return; } - + _trackImage = nil; _minimumTrackImage = minimumTrackImage; - _minimumTrackImage = [_minimumTrackImage resizableImageWithCapInsets:(UIEdgeInsets) { - 0, _minimumTrackImage.size.width, 0, 0 - } resizingMode:UIImageResizingModeStretch]; + _minimumTrackImage = + [_minimumTrackImage resizableImageWithCapInsets:(UIEdgeInsets){0, _minimumTrackImage.size.width, 0, 0} + resizingMode:UIImageResizingModeStretch]; [_sliderView setMinimumTrackImage:_minimumTrackImage forState:UIControlStateNormal]; } --(void)setMaximumTrackImage:(UIImage *)maximumTrackImage { +- (void)setMaximumTrackImage:(UIImage *)maximumTrackImage +{ if ([maximumTrackImage isEqual:_maximumTrackImage] && _trackImage == nil) { return; } - + _trackImage = nil; _maximumTrackImage = maximumTrackImage; - _maximumTrackImage = [_maximumTrackImage resizableImageWithCapInsets:(UIEdgeInsets) { - 0, 0, 0, _maximumTrackImage.size.width - } resizingMode:UIImageResizingModeStretch]; + _maximumTrackImage = + [_maximumTrackImage resizableImageWithCapInsets:(UIEdgeInsets){0, 0, 0, _maximumTrackImage.size.width} + resizingMode:UIImageResizingModeStretch]; [_sliderView setMaximumTrackImage:_maximumTrackImage forState:UIControlStateNormal]; } --(void)setThumbImage:(UIImage *)thumbImage { +- (void)setThumbImage:(UIImage *)thumbImage +{ if ([thumbImage isEqual:_thumbImage]) { return; } - + _thumbImage = thumbImage; [_sliderView setThumbImage:thumbImage forState:UIControlStateNormal]; } @@ -289,14 +291,12 @@ using namespace facebook::react; float value = sender.value; const auto &props = *std::static_pointer_cast(_props); - + if (props.step > 0 && value <= (props.maximumValue - props.minimumValue)) { - value = MAX(props.minimumValue, - MIN(props.maximumValue, - props.minimumValue + round((value - props.minimumValue) / props.step) * props.step - ) - ); - + value = MAX( + props.minimumValue, + MIN(props.maximumValue, props.minimumValue + round((value - props.minimumValue) / props.step) * props.step)); + [_sliderView setValue:value animated:YES]; } @@ -306,7 +306,7 @@ using namespace facebook::react; if (!continuous) { std::dynamic_pointer_cast(_eventEmitter)->onSlidingComplete(value); } - + _previousValue = value; } @@ -325,11 +325,12 @@ using namespace facebook::react; } } -- (void)didReceiveProgress:(float)progress fromObserver:(void *)observer { +- (void)didReceiveProgress:(float)progress fromObserver:(void *)observer +{ } -- (void)didReceiveFailureFromObserver:(void *)observer { +- (void)didReceiveFailureFromObserver:(void *)observer +{ } - @end diff --git a/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.mm b/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.mm index 54cb8b2cd..49e8e49d8 100644 --- a/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.mm @@ -26,9 +26,7 @@ using namespace facebook::react; _switchView = [[UISwitch alloc] initWithFrame:self.bounds]; - [_switchView addTarget:self - action:@selector(onChange:) - forControlEvents:UIControlEventValueChanged]; + [_switchView addTarget:self action:@selector(onChange:) forControlEvents:UIControlEventValueChanged]; _switchView.on = defaultProps->value; @@ -86,7 +84,8 @@ using namespace facebook::react; } _wasOn = sender.on; - std::dynamic_pointer_cast(_eventEmitter)->onChange(SwitchOnChangeStruct{.value=static_cast(sender.on)}); + std::dynamic_pointer_cast(_eventEmitter) + ->onChange(SwitchOnChangeStruct{.value = static_cast(sender.on)}); } @end diff --git a/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm b/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm index 90ad5d2e4..430039239 100644 --- a/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm @@ -12,8 +12,8 @@ #import #import #import -#import #import +#import #import "RCTConversions.h" using namespace facebook::react; @@ -55,8 +55,7 @@ using namespace facebook::react; _paragraphAttributes = paragraphProps->paragraphAttributes; } -- (void)updateLocalData:(SharedLocalData)localData - oldLocalData:(SharedLocalData)oldLocalData +- (void)updateLocalData:(SharedLocalData)localData oldLocalData:(SharedLocalData)oldLocalData { _paragraphLocalData = std::static_pointer_cast(localData); assert(_paragraphLocalData); @@ -75,10 +74,9 @@ using namespace facebook::react; return; } - SharedTextLayoutManager textLayoutManager = - _paragraphLocalData->getTextLayoutManager(); + SharedTextLayoutManager textLayoutManager = _paragraphLocalData->getTextLayoutManager(); RCTTextLayoutManager *nativeTextLayoutManager = - (__bridge RCTTextLayoutManager *)textLayoutManager->getNativeTextLayoutManager(); + (__bridge RCTTextLayoutManager *)textLayoutManager->getNativeTextLayoutManager(); CGRect frame = RCTCGRectFromRect(_layoutMetrics.getContentFrame()); @@ -91,8 +89,7 @@ using namespace facebook::react; - (NSString *)accessibilityLabel { - NSString *superAccessibilityLabel = - RCTNSStringFromStringNilIfEmpty(_props->accessibilityLabel); + NSString *superAccessibilityLabel = RCTNSStringFromStringNilIfEmpty(_props->accessibilityLabel); if (superAccessibilityLabel) { return superAccessibilityLabel; } @@ -111,14 +108,15 @@ using namespace facebook::react; } SharedTextLayoutManager textLayoutManager = _paragraphLocalData->getTextLayoutManager(); - RCTTextLayoutManager *nativeTextLayoutManager = (__bridge RCTTextLayoutManager *)textLayoutManager->getNativeTextLayoutManager(); + RCTTextLayoutManager *nativeTextLayoutManager = + (__bridge RCTTextLayoutManager *)textLayoutManager->getNativeTextLayoutManager(); CGRect frame = RCTCGRectFromRect(_layoutMetrics.getContentFrame()); SharedEventEmitter eventEmitter = - [nativeTextLayoutManager getEventEmitterWithAttributeString:_paragraphLocalData->getAttributedString() - paragraphAttributes:_paragraphAttributes - frame:frame - atPoint:point]; + [nativeTextLayoutManager getEventEmitterWithAttributeString:_paragraphLocalData->getAttributedString() + paragraphAttributes:_paragraphAttributes + frame:frame + atPoint:point]; if (!eventEmitter) { return _eventEmitter; diff --git a/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h b/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h index 0b8a6dda0..3e85e52aa 100644 --- a/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h +++ b/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h @@ -8,13 +8,13 @@ #import #import +#import #import -#import -#import #import #import +#import +#import #import -#import NS_ASSUME_NONNULL_BEGIN @@ -22,7 +22,7 @@ NS_ASSUME_NONNULL_BEGIN * UIView class for component. */ @interface RCTViewComponentView : UIView { -@protected + @protected facebook::react::LayoutMetrics _layoutMetrics; facebook::react::SharedViewProps _props; facebook::react::SharedViewEventEmitter _eventEmitter; diff --git a/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm index 82ae59c11..9dd1a72aa 100644 --- a/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm @@ -7,19 +7,18 @@ #import "RCTViewComponentView.h" -#import -#import -#import -#import #import #import +#import +#import +#import +#import #import "RCTConversions.h" using namespace facebook::react; -@implementation RCTViewComponentView -{ +@implementation RCTViewComponentView { UIColor *_backgroundColor; CALayer *_borderLayer; } @@ -84,25 +83,23 @@ using namespace facebook::react; + (ComponentHandle)componentHandle { RCTAssert( - self == [RCTViewComponentView class], - @"`+[RCTComponentViewProtocol componentHandle]` must be implemented for all subclasses (and `%@` particularly).", NSStringFromClass([self class])); + self == [RCTViewComponentView class], + @"`+[RCTComponentViewProtocol componentHandle]` must be implemented for all subclasses (and `%@` particularly).", + NSStringFromClass([self class])); return ViewShadowNode::Handle(); } -- (void)updateProps:(SharedProps)props - oldProps:(SharedProps)oldProps +- (void)updateProps:(SharedProps)props oldProps:(SharedProps)oldProps { #ifndef NS_BLOCK_ASSERTIONS auto propsRawPtr = _props.get(); RCTAssert( - propsRawPtr && - ( - [self class] == [RCTViewComponentView class] || - typeid(*propsRawPtr).hash_code() != typeid(const ViewProps).hash_code() - ), - @"`RCTViewComponentView` subclasses (and `%@` particularly) must setup `_props`" - " instance variable with a default value in the constructor.", NSStringFromClass([self class]) - ); + propsRawPtr && + ([self class] == [RCTViewComponentView class] || + typeid(*propsRawPtr).hash_code() != typeid(const ViewProps).hash_code()), + @"`RCTViewComponentView` subclasses (and `%@` particularly) must setup `_props`" + " instance variable with a default value in the constructor.", + NSStringFromClass([self class])); #endif const auto &oldViewProps = *std::static_pointer_cast(oldProps ?: _props); @@ -194,11 +191,8 @@ using namespace facebook::react; } // `border` - if ( - oldViewProps.borderStyles != newViewProps.borderStyles || - oldViewProps.borderRadii != newViewProps.borderRadii || - oldViewProps.borderColors != newViewProps.borderColors - ) { + if (oldViewProps.borderStyles != newViewProps.borderStyles || oldViewProps.borderRadii != newViewProps.borderRadii || + oldViewProps.borderColors != newViewProps.borderColors) { needsInvalidateLayer = YES; } @@ -224,7 +218,8 @@ using namespace facebook::react; // `accessibilityTraits` if (oldViewProps.accessibilityTraits != newViewProps.accessibilityTraits) { - self.accessibilityElement.accessibilityTraits = RCTUIAccessibilityTraitsFromAccessibilityTraits(newViewProps.accessibilityTraits); + self.accessibilityElement.accessibilityTraits = + RCTUIAccessibilityTraitsFromAccessibilityTraits(newViewProps.accessibilityTraits); } // `accessibilityViewIsModal` @@ -257,8 +252,7 @@ using namespace facebook::react; _eventEmitter = std::static_pointer_cast(eventEmitter); } -- (void)updateLayoutMetrics:(LayoutMetrics)layoutMetrics - oldLayoutMetrics:(LayoutMetrics)oldLayoutMetrics +- (void)updateLayoutMetrics:(LayoutMetrics)layoutMetrics oldLayoutMetrics:(LayoutMetrics)oldLayoutMetrics { _layoutMetrics = layoutMetrics; @@ -291,11 +285,11 @@ using namespace facebook::react; } NSArray<__kindof UIView *> *sortedSubviews = - [self.subviews sortedArrayUsingComparator:^NSComparisonResult(UIView *a, UIView *b) { - // Ensure sorting is stable by treating equal `zIndex` as ascending so - // that original order is preserved. - return a.layer.zPosition > b.layer.zPosition ? NSOrderedDescending : NSOrderedAscending; - }]; + [self.subviews sortedArrayUsingComparator:^NSComparisonResult(UIView *a, UIView *b) { + // Ensure sorting is stable by treating equal `zIndex` as ascending so + // that original order is preserved. + return a.layer.zPosition > b.layer.zPosition ? NSOrderedDescending : NSOrderedAscending; + }]; for (UIView *subview in [sortedSubviews reverseObjectEnumerator]) { UIView *hitView = [subview hitTest:[subview convertPoint:point fromView:self] withEvent:event]; @@ -322,34 +316,32 @@ using namespace facebook::react; } } -static RCTCornerRadii RCTCornerRadiiFromBorderRadii(BorderRadii borderRadii) { - return RCTCornerRadii { - .topLeft = (CGFloat)borderRadii.topLeft, - .topRight = (CGFloat)borderRadii.topRight, - .bottomLeft = (CGFloat)borderRadii.bottomLeft, - .bottomRight = (CGFloat)borderRadii.bottomRight - }; +static RCTCornerRadii RCTCornerRadiiFromBorderRadii(BorderRadii borderRadii) +{ + return RCTCornerRadii{.topLeft = (CGFloat)borderRadii.topLeft, + .topRight = (CGFloat)borderRadii.topRight, + .bottomLeft = (CGFloat)borderRadii.bottomLeft, + .bottomRight = (CGFloat)borderRadii.bottomRight}; } -static RCTBorderColors RCTBorderColorsFromBorderColors(BorderColors borderColors) { - return RCTBorderColors { - .left = RCTCGColorRefFromSharedColor(borderColors.left), - .top = RCTCGColorRefFromSharedColor(borderColors.top), - .bottom = RCTCGColorRefFromSharedColor(borderColors.bottom), - .right = RCTCGColorRefFromSharedColor(borderColors.right) - }; +static RCTBorderColors RCTBorderColorsFromBorderColors(BorderColors borderColors) +{ + return RCTBorderColors{.left = RCTCGColorRefFromSharedColor(borderColors.left), + .top = RCTCGColorRefFromSharedColor(borderColors.top), + .bottom = RCTCGColorRefFromSharedColor(borderColors.bottom), + .right = RCTCGColorRefFromSharedColor(borderColors.right)}; } -static UIEdgeInsets UIEdgeInsetsFromBorderInsets(EdgeInsets edgeInsets) { - return UIEdgeInsets { - .left = (CGFloat)edgeInsets.left, - .top = (CGFloat)edgeInsets.top, - .bottom = (CGFloat)edgeInsets.bottom, - .right = (CGFloat)edgeInsets.right - }; +static UIEdgeInsets UIEdgeInsetsFromBorderInsets(EdgeInsets edgeInsets) +{ + return UIEdgeInsets{.left = (CGFloat)edgeInsets.left, + .top = (CGFloat)edgeInsets.top, + .bottom = (CGFloat)edgeInsets.bottom, + .right = (CGFloat)edgeInsets.right}; } -static RCTBorderStyle RCTBorderStyleFromBorderStyle(BorderStyle borderStyle) { +static RCTBorderStyle RCTBorderStyleFromBorderStyle(BorderStyle borderStyle) +{ switch (borderStyle) { case BorderStyle::Solid: return RCTBorderStyleSolid; @@ -363,7 +355,7 @@ static RCTBorderStyle RCTBorderStyleFromBorderStyle(BorderStyle borderStyle) { - (void)invalidateLayer { const auto borderMetrics = - _props->resolveBorderMetrics(_layoutMetrics.layoutDirection == LayoutDirection::RightToLeft); + _props->resolveBorderMetrics(_layoutMetrics.layoutDirection == LayoutDirection::RightToLeft); CALayer *layer = self.layer; @@ -373,7 +365,7 @@ static RCTBorderStyle RCTBorderStyleFromBorderStyle(BorderStyle borderStyle) { if (CGColorGetAlpha(_backgroundColor.CGColor) > 0.999) { // If view has a solid background color, calculate shadow path from border. const RCTCornerInsets cornerInsets = - RCTGetCornerInsets(RCTCornerRadiiFromBorderRadii(borderMetrics.borderRadii), UIEdgeInsetsZero); + RCTGetCornerInsets(RCTCornerRadiiFromBorderRadii(borderMetrics.borderRadii), UIEdgeInsetsZero); CGPathRef shadowPath = RCTPathCreateWithRoundedRect(self.bounds, cornerInsets, nil); layer.shadowPath = shadowPath; CGPathRelease(shadowPath); @@ -387,19 +379,15 @@ static RCTBorderStyle RCTBorderStyleFromBorderStyle(BorderStyle borderStyle) { // Stage 2. Border Rendering const bool useCoreAnimationBorderRendering = - borderMetrics.borderColors.isUniform() && - borderMetrics.borderWidths.isUniform() && - borderMetrics.borderStyles.isUniform() && - borderMetrics.borderRadii.isUniform() && - borderMetrics.borderStyles.left == BorderStyle::Solid && - ( - // iOS draws borders in front of the content whereas CSS draws them behind - // the content. For this reason, only use iOS border drawing when clipping - // or when the border is hidden. - borderMetrics.borderWidths.left == 0 || - colorComponentsFromColor(borderMetrics.borderColors.left).alpha == 0 || - self.clipsToBounds - ); + borderMetrics.borderColors.isUniform() && borderMetrics.borderWidths.isUniform() && + borderMetrics.borderStyles.isUniform() && borderMetrics.borderRadii.isUniform() && + borderMetrics.borderStyles.left == BorderStyle::Solid && + ( + // iOS draws borders in front of the content whereas CSS draws them behind + // the content. For this reason, only use iOS border drawing when clipping + // or when the border is hidden. + borderMetrics.borderWidths.left == 0 || + colorComponentsFromColor(borderMetrics.borderColors.left).alpha == 0 || self.clipsToBounds); if (useCoreAnimationBorderRendering) { if (_borderLayer) { @@ -430,24 +418,22 @@ static RCTBorderStyle RCTBorderStyleFromBorderStyle(BorderStyle borderStyle) { _contentView.layer.masksToBounds = NO; UIImage *image = RCTGetBorderImage( - RCTBorderStyleFromBorderStyle(borderMetrics.borderStyles.left), - layer.bounds.size, - RCTCornerRadiiFromBorderRadii(borderMetrics.borderRadii), - UIEdgeInsetsFromBorderInsets(borderMetrics.borderWidths), - RCTBorderColorsFromBorderColors(borderMetrics.borderColors), - _backgroundColor.CGColor, - self.clipsToBounds - ); + RCTBorderStyleFromBorderStyle(borderMetrics.borderStyles.left), + layer.bounds.size, + RCTCornerRadiiFromBorderRadii(borderMetrics.borderRadii), + UIEdgeInsetsFromBorderInsets(borderMetrics.borderWidths), + RCTBorderColorsFromBorderColors(borderMetrics.borderColors), + _backgroundColor.CGColor, + self.clipsToBounds); if (image == nil) { _borderLayer.contents = nil; } else { CGSize imageSize = image.size; UIEdgeInsets imageCapInsets = image.capInsets; - CGRect contentsCenter = CGRect { - CGPoint {imageCapInsets.left / imageSize.width, imageCapInsets.top / imageSize.height}, - CGSize {(CGFloat)1.0 / imageSize.width, (CGFloat)1.0 / imageSize.height} - }; + CGRect contentsCenter = + CGRect{CGPoint{imageCapInsets.left / imageSize.width, imageCapInsets.top / imageSize.height}, + CGSize{(CGFloat)1.0 / imageSize.width, (CGFloat)1.0 / imageSize.height}}; _borderLayer.contents = (id)image.CGImage; _borderLayer.contentsScale = image.scale; @@ -456,7 +442,7 @@ static RCTBorderStyle RCTBorderStyleFromBorderStyle(BorderStyle borderStyle) { if (isResizable) { _borderLayer.contentsCenter = contentsCenter; } else { - _borderLayer.contentsCenter = CGRect { CGPoint {0.0, 0.0}, CGSize {1.0, 1.0}}; + _borderLayer.contentsCenter = CGRect{CGPoint{0.0, 0.0}, CGSize{1.0, 1.0}}; } } @@ -470,10 +456,9 @@ static RCTBorderStyle RCTBorderStyleFromBorderStyle(BorderStyle borderStyle) { } else { // In this case we have to generate masking layer manually. CGPathRef path = RCTPathCreateWithRoundedRect( - self.bounds, - RCTGetCornerInsets(RCTCornerRadiiFromBorderRadii(borderMetrics.borderRadii), UIEdgeInsetsZero), - nil - ); + self.bounds, + RCTGetCornerInsets(RCTCornerRadiiFromBorderRadii(borderMetrics.borderRadii), UIEdgeInsetsZero), + nil); maskLayer = [CAShapeLayer layer]; maskLayer.path = path; @@ -533,9 +518,10 @@ static NSString *RCTRecursiveAccessibilityLabel(UIView *view) NSMutableArray *customActions = [NSMutableArray array]; for (const auto &accessibilityAction : accessibilityActions) { - [customActions addObject:[[UIAccessibilityCustomAction alloc] initWithName:RCTNSStringFromString(accessibilityAction) - target:self - selector:@selector(didActivateAccessibilityCustomAction:)]]; + [customActions + addObject:[[UIAccessibilityCustomAction alloc] initWithName:RCTNSStringFromString(accessibilityAction) + target:self + selector:@selector(didActivateAccessibilityCustomAction:)]]; } return [customActions copy]; diff --git a/React/Fabric/Mounting/MountItems/RCTCreateMountItem.h b/React/Fabric/Mounting/MountItems/RCTCreateMountItem.h index 344fd1ab7..a503df5a9 100644 --- a/React/Fabric/Mounting/MountItems/RCTCreateMountItem.h +++ b/React/Fabric/Mounting/MountItems/RCTCreateMountItem.h @@ -7,9 +7,9 @@ #import -#import #import #import +#import NS_ASSUME_NONNULL_BEGIN @@ -20,8 +20,7 @@ NS_ASSUME_NONNULL_BEGIN */ @interface RCTCreateMountItem : NSObject -- (instancetype)initWithComponentHandle:(facebook::react::ComponentHandle)componentHandle - tag:(ReactTag)tag; +- (instancetype)initWithComponentHandle:(facebook::react::ComponentHandle)componentHandle tag:(ReactTag)tag; @end diff --git a/React/Fabric/Mounting/MountItems/RCTCreateMountItem.mm b/React/Fabric/Mounting/MountItems/RCTCreateMountItem.mm index a91f0194c..ace7dad11 100644 --- a/React/Fabric/Mounting/MountItems/RCTCreateMountItem.mm +++ b/React/Fabric/Mounting/MountItems/RCTCreateMountItem.mm @@ -16,8 +16,7 @@ using namespace facebook::react; ReactTag _tag; } -- (instancetype)initWithComponentHandle:(facebook::react::ComponentHandle)componentHandle - tag:(ReactTag)tag +- (instancetype)initWithComponentHandle:(facebook::react::ComponentHandle)componentHandle tag:(ReactTag)tag { if (self = [super init]) { _componentHandle = componentHandle; diff --git a/React/Fabric/Mounting/MountItems/RCTDeleteMountItem.h b/React/Fabric/Mounting/MountItems/RCTDeleteMountItem.h index f0d07b47c..ac53f3c22 100644 --- a/React/Fabric/Mounting/MountItems/RCTDeleteMountItem.h +++ b/React/Fabric/Mounting/MountItems/RCTDeleteMountItem.h @@ -7,9 +7,9 @@ #import -#import #import #import +#import NS_ASSUME_NONNULL_BEGIN @@ -18,8 +18,7 @@ NS_ASSUME_NONNULL_BEGIN */ @interface RCTDeleteMountItem : NSObject -- (instancetype)initWithComponentHandle:(facebook::react::ComponentHandle)componentHandle - tag:(ReactTag)tag; +- (instancetype)initWithComponentHandle:(facebook::react::ComponentHandle)componentHandle tag:(ReactTag)tag; @end diff --git a/React/Fabric/Mounting/MountItems/RCTDeleteMountItem.mm b/React/Fabric/Mounting/MountItems/RCTDeleteMountItem.mm index 9528d60ca..58f20cec1 100644 --- a/React/Fabric/Mounting/MountItems/RCTDeleteMountItem.mm +++ b/React/Fabric/Mounting/MountItems/RCTDeleteMountItem.mm @@ -16,8 +16,7 @@ using namespace facebook::react; ReactTag _tag; } -- (instancetype)initWithComponentHandle:(facebook::react::ComponentHandle)componentHandle - tag:(ReactTag)tag +- (instancetype)initWithComponentHandle:(facebook::react::ComponentHandle)componentHandle tag:(ReactTag)tag { if (self = [super init]) { _componentHandle = componentHandle; diff --git a/React/Fabric/Mounting/MountItems/RCTInsertMountItem.h b/React/Fabric/Mounting/MountItems/RCTInsertMountItem.h index dbae0a108..43a0d2403 100644 --- a/React/Fabric/Mounting/MountItems/RCTInsertMountItem.h +++ b/React/Fabric/Mounting/MountItems/RCTInsertMountItem.h @@ -19,9 +19,7 @@ NS_ASSUME_NONNULL_BEGIN */ @interface RCTInsertMountItem : NSObject -- (instancetype)initWithChildTag:(ReactTag)childTag - parentTag:(ReactTag)parentTag - index:(NSInteger)index; +- (instancetype)initWithChildTag:(ReactTag)childTag parentTag:(ReactTag)parentTag index:(NSInteger)index; @end diff --git a/React/Fabric/Mounting/MountItems/RCTInsertMountItem.mm b/React/Fabric/Mounting/MountItems/RCTInsertMountItem.mm index 15894efe2..fad2f055a 100644 --- a/React/Fabric/Mounting/MountItems/RCTInsertMountItem.mm +++ b/React/Fabric/Mounting/MountItems/RCTInsertMountItem.mm @@ -15,9 +15,7 @@ NSInteger _index; } -- (instancetype)initWithChildTag:(ReactTag)childTag - parentTag:(ReactTag)parentTag - index:(NSInteger)index +- (instancetype)initWithChildTag:(ReactTag)childTag parentTag:(ReactTag)parentTag index:(NSInteger)index { if (self = [super init]) { _childTag = childTag; @@ -37,8 +35,7 @@ return; } - [parentComponentView mountChildComponentView:childComponentView - index:_index]; + [parentComponentView mountChildComponentView:childComponentView index:_index]; } @end diff --git a/React/Fabric/Mounting/MountItems/RCTRemoveMountItem.h b/React/Fabric/Mounting/MountItems/RCTRemoveMountItem.h index 3d3875192..ec8b58403 100644 --- a/React/Fabric/Mounting/MountItems/RCTRemoveMountItem.h +++ b/React/Fabric/Mounting/MountItems/RCTRemoveMountItem.h @@ -17,9 +17,7 @@ NS_ASSUME_NONNULL_BEGIN */ @interface RCTRemoveMountItem : NSObject -- (instancetype)initWithChildTag:(ReactTag)childTag - parentTag:(ReactTag)parentTag - index:(NSInteger)index; +- (instancetype)initWithChildTag:(ReactTag)childTag parentTag:(ReactTag)parentTag index:(NSInteger)index; @end diff --git a/React/Fabric/Mounting/MountItems/RCTRemoveMountItem.mm b/React/Fabric/Mounting/MountItems/RCTRemoveMountItem.mm index 341929cac..e753c03f6 100644 --- a/React/Fabric/Mounting/MountItems/RCTRemoveMountItem.mm +++ b/React/Fabric/Mounting/MountItems/RCTRemoveMountItem.mm @@ -15,9 +15,7 @@ NSInteger _index; } -- (instancetype)initWithChildTag:(ReactTag)childTag - parentTag:(ReactTag)parentTag - index:(NSInteger)index +- (instancetype)initWithChildTag:(ReactTag)childTag parentTag:(ReactTag)parentTag index:(NSInteger)index { if (self = [super init]) { _childTag = childTag; @@ -37,8 +35,7 @@ return; } - [parentComponentView unmountChildComponentView:childComponentView - index:_index]; + [parentComponentView unmountChildComponentView:childComponentView index:_index]; } @end diff --git a/React/Fabric/Mounting/MountItems/RCTUpdateEventEmitterMountItem.h b/React/Fabric/Mounting/MountItems/RCTUpdateEventEmitterMountItem.h index 24f37679f..7d16a9dc2 100644 --- a/React/Fabric/Mounting/MountItems/RCTUpdateEventEmitterMountItem.h +++ b/React/Fabric/Mounting/MountItems/RCTUpdateEventEmitterMountItem.h @@ -18,8 +18,7 @@ NS_ASSUME_NONNULL_BEGIN */ @interface RCTUpdateEventEmitterMountItem : NSObject -- (instancetype)initWithTag:(ReactTag)tag - eventEmitter:(facebook::react::SharedEventEmitter)eventEmitter; +- (instancetype)initWithTag:(ReactTag)tag eventEmitter:(facebook::react::SharedEventEmitter)eventEmitter; @end diff --git a/React/Fabric/Mounting/MountItems/RCTUpdateEventEmitterMountItem.mm b/React/Fabric/Mounting/MountItems/RCTUpdateEventEmitterMountItem.mm index f94a08597..6ef2fee2c 100644 --- a/React/Fabric/Mounting/MountItems/RCTUpdateEventEmitterMountItem.mm +++ b/React/Fabric/Mounting/MountItems/RCTUpdateEventEmitterMountItem.mm @@ -16,8 +16,7 @@ using namespace facebook::react; SharedEventEmitter _eventEmitter; } -- (instancetype)initWithTag:(ReactTag)tag - eventEmitter:(SharedEventEmitter)eventEmitter +- (instancetype)initWithTag:(ReactTag)tag eventEmitter:(SharedEventEmitter)eventEmitter { if (self = [super init]) { _tag = tag; diff --git a/React/Fabric/Mounting/MountItems/RCTUpdateLayoutMetricsMountItem.mm b/React/Fabric/Mounting/MountItems/RCTUpdateLayoutMetricsMountItem.mm index 71b76c326..695ac1d35 100644 --- a/React/Fabric/Mounting/MountItems/RCTUpdateLayoutMetricsMountItem.mm +++ b/React/Fabric/Mounting/MountItems/RCTUpdateLayoutMetricsMountItem.mm @@ -34,8 +34,7 @@ using namespace facebook::react; { UIView *componentView = [registry componentViewByTag:_tag]; - [componentView updateLayoutMetrics:_newLayoutMetrics - oldLayoutMetrics:_oldLayoutMetrics]; + [componentView updateLayoutMetrics:_newLayoutMetrics oldLayoutMetrics:_oldLayoutMetrics]; } @end diff --git a/React/Fabric/Mounting/MountItems/RCTUpdatePropsMountItem.mm b/React/Fabric/Mounting/MountItems/RCTUpdatePropsMountItem.mm index 4587a5ec9..ae415cb44 100644 --- a/React/Fabric/Mounting/MountItems/RCTUpdatePropsMountItem.mm +++ b/React/Fabric/Mounting/MountItems/RCTUpdatePropsMountItem.mm @@ -17,9 +17,7 @@ using namespace facebook::react; SharedProps _newProps; } -- (instancetype)initWithTag:(ReactTag)tag - oldProps:(SharedProps)oldProps - newProps:(SharedProps)newProps +- (instancetype)initWithTag:(ReactTag)tag oldProps:(SharedProps)oldProps newProps:(SharedProps)newProps { if (self = [super init]) { _tag = tag;