diff --git a/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.js b/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.js index 4faf1dd92e5425..a2d7a3310ef343 100644 --- a/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.js +++ b/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.js @@ -34,11 +34,11 @@ export type EdgeInsetsValue = { bottom: number, }; -export type CursorValue = ?('auto' | 'pointer'); - export type DimensionValue = number | string | 'auto' | AnimatedNode | null; export type AnimatableNumericValue = number | AnimatedNode; +export type CursorValue = 'auto' | 'pointer'; + /** * React Native's layout system is based on Flexbox and is powered both * on iOS and Android by an open source project called `Yoga`: diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm index b85b0fab2e86a8..8dfe30a7a0a9db 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm @@ -32,7 +32,6 @@ @implementation RCTViewComponentView { BOOL _needsInvalidateLayer; BOOL _isJSResponder; BOOL _removeClippedSubviews; - Cursor _cursor; NSMutableArray *_reactSubviews; NSSet *_Nullable _propKeysManagedByAnimated_DO_NOT_USE_THIS_IS_BROKEN; } @@ -50,7 +49,6 @@ - (instancetype)initWithFrame:(CGRect)frame _props = ViewShadowNode::defaultSharedProps(); _reactSubviews = [NSMutableArray new]; self.multipleTouchEnabled = YES; - _cursor = Cursor::Auto; } return self; } @@ -261,7 +259,6 @@ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared & // `cursor` if (oldViewProps.cursor != newViewProps.cursor) { - _cursor = newViewProps.cursor; needsInvalidateLayer = YES; } @@ -603,7 +600,7 @@ - (void)invalidateLayer // Stage 1.5. Cursor / Hover Effects if (@available(iOS 17.0, *)) { UIHoverStyle *hoverStyle = nil; - if (_cursor == Cursor::Pointer) { + if (_props->cursor == Cursor::Pointer) { const RCTCornerInsets cornerInsets = RCTGetCornerInsets(RCTCornerRadiiFromBorderRadii(borderMetrics.borderRadii), UIEdgeInsetsZero); #if TARGET_OS_IOS