Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion packages/react-native/React/Base/macOS/RCTUIKit.m
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ @implementation RCTUIView
BOOL _clipsToBounds;
BOOL _userInteractionEnabled;
BOOL _mouseDownCanMoveWindow;
BOOL _respondsToDisplayLayer;
}

+ (NSSet<NSString *> *)keyPathsForValuesAffectingValueForKey:(NSString *)key
Expand Down Expand Up @@ -158,6 +159,7 @@ @implementation RCTUIView
self->_userInteractionEnabled = YES;
self->_enableFocusRing = YES;
self->_mouseDownCanMoveWindow = YES;
self->_respondsToDisplayLayer = [self respondsToSelector:@selector(displayLayer:)];
}
return self;
}
Expand Down Expand Up @@ -259,7 +261,12 @@ - (void)updateLayer
// so it has to be reset from the view's NSColor ivar.
[layer setBackgroundColor:[_backgroundColor CGColor]];
}
[(id<CALayerDelegate>)self displayLayer:layer];

// In Fabric, wantsUpdateLayer is always enabled and doesn't guarantee that
// the instance has a displayLayer method.
if (_respondsToDisplayLayer) {
[(id<CALayerDelegate>)self displayLayer:layer];
}
}

- (void)drawRect:(CGRect)rect
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2025,6 +2025,11 @@ - (NSString *)componentViewName_DO_NOT_USE_THIS_IS_BROKEN
return RCTNSStringFromString([[self class] componentDescriptorProvider].name);
}

- (BOOL)wantsUpdateLayer
{
return YES;
}

@end

#ifdef __cplusplus
Expand Down
Loading