Skip to content

Commit 97b19c1

Browse files
committed
[macOS] Fix build on old architecture (#3182)
## Description Currently macOS fails to build on old architecture. This PR fixes that. ## Test plan Run MacOSExample on paper.
1 parent 36bf1dc commit 97b19c1

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

apple/RNGestureHandlerButton.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,25 @@
1010

1111
#if TARGET_OS_OSX
1212

13+
#if RCT_NEW_ARCH_ENABLED
14+
1315
#include <react/renderer/core/LayoutMetrics.h>
1416

1517
@protocol RCTComponentViewProtocol;
1618

19+
#endif // RCT_NEW_ARCH_ENABLED
20+
1721
@interface RNGestureHandlerButton : NSControl
1822
#else
1923
@interface RNGestureHandlerButton : UIControl
20-
#endif
24+
#endif // TARGET_OS_OSX
2125
/**
2226
* Insets used when hit testing inside this view.
2327
*/
2428
@property (nonatomic, assign) UIEdgeInsets hitTestEdgeInsets;
2529
@property (nonatomic) BOOL userEnabled;
2630

27-
#if TARGET_OS_OSX
31+
#if TARGET_OS_OSX && RCT_NEW_ARCH_ENABLED
2832
- (void)mountChildComponentView:(RNGHUIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index;
2933
- (void)unmountChildComponentView:(RNGHUIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index;
3034
- (void)updateLayoutMetrics:(const facebook::react::LayoutMetrics &)layoutMetrics

apple/RNGestureHandlerButton.mm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@
1414
#import <React/RCTUIKit.h>
1515
#endif
1616

17+
#if RCT_NEW_ARCH_ENABLED
18+
1719
#import <React/RCTConversions.h>
1820
#import <React/RCTFabricComponentsPlugins.h>
1921

22+
#endif
23+
2024
/**
2125
* Gesture Handler Button components overrides standard mechanism used by RN
2226
* to determine touch target, which normally would reurn the UIView that is placed
@@ -87,7 +91,7 @@ - (RNGHUIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
8791
}
8892
#endif
8993

90-
#if TARGET_OS_OSX
94+
#if TARGET_OS_OSX && RCT_NEW_ARCH_ENABLED
9195
- (void)mountChildComponentView:(RNGHUIView *)childComponentView index:(NSInteger)index
9296
{
9397
if (childComponentView.superview != nil) {

0 commit comments

Comments
 (0)