#ifdef RCT_NEW_ARCH_ENABLED #import "RNGestureHandlerButtonComponentView.h" #import #import #import #import #import #import #import "RNGestureHandlerButton.h" using namespace facebook::react; @interface RNGestureHandlerButtonComponentView () @end @implementation RNGestureHandlerButtonComponentView { RNGestureHandlerButton *_buttonView; } - (instancetype)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { static const auto defaultProps = std::make_shared(); _props = defaultProps; _buttonView = [[RNGestureHandlerButton alloc] initWithFrame:self.bounds]; self.contentView = _buttonView; } return self; } #pragma mark - RCTComponentViewProtocol + (ComponentDescriptorProvider)componentDescriptorProvider { return concreteComponentDescriptorProvider(); } - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &)oldProps { const auto &newProps = *std::static_pointer_cast(props); _buttonView.userEnabled = newProps.enabled; #if !TARGET_OS_TV _buttonView.exclusiveTouch = newProps.exclusive; #endif _buttonView.hitTestEdgeInsets = UIEdgeInsetsMake( -newProps.hitSlop.top, -newProps.hitSlop.left, -newProps.hitSlop.bottom, -newProps.hitSlop.right); [super updateProps:props oldProps:oldProps]; } @end Class RNGestureHandlerButtonCls(void) { return RNGestureHandlerButtonComponentView.class; } #endif // RCT_NEW_ARCH_ENABLED