Skip to content

Commit 6b7246e

Browse files
committed
add ifdef for NSView
1 parent bbef9bb commit 6b7246e

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ NS_ASSUME_NONNULL_BEGIN
5656
* transparent in favour of some subview.
5757
* Defaults to `self`.
5858
*/
59-
@property (nonatomic, strong, nullable, readonly) RCTPlatformView *accessibilityElement; // [macOS]
59+
#if !TARGET_OS_OSX // [macOS]
60+
@property (nonatomic, strong, nullable, readonly) NSObject *accessibilityElement;
61+
#else // [macOS
62+
@property (nonatomic, strong, nullable, readonly) NSView *accessibilityElement;
63+
#endif // macOS]
6064

6165
/**
6266
* Insets used when hit testing inside this view.

packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1318,7 +1318,11 @@ - (void)clearExistingBackgroundImageLayers
13181318

13191319
#pragma mark - Accessibility
13201320

1321-
- (RCTPlatformView *)accessibilityElement
1321+
#if !TARGET_OS_OSX // [macOS]
1322+
- (NSObject *)accessibilityElement
1323+
#else // [macOS
1324+
- (NSView *)accessibilityElement // macOS]
1325+
#endif // macOS]
13221326
{
13231327
return self;
13241328
}

0 commit comments

Comments
 (0)