diff --git a/React/Views/RCTView.m b/React/Views/RCTView.m index 653d0efde61f7a..98398ad8953b14 100644 --- a/React/Views/RCTView.m +++ b/React/Views/RCTView.m @@ -716,6 +716,22 @@ - (NSString *)description #endif // TODO(macOS GH#774) #if TARGET_OS_OSX // [TODO(macOS GH#774) +// Workaround AppKit issue with directly manipulating the view layer's shadow. +- (NSShadow*)shadow +{ + CALayer *layer = self.layer; + NSShadow *shadow = nil; + + if (layer.shadowColor != nil && layer.shadowOpacity > 0) { + shadow = [NSShadow new]; + + shadow.shadowColor = [[NSColor colorWithCGColor:layer.shadowColor] colorWithAlphaComponent:layer.shadowOpacity]; + shadow.shadowOffset = layer.shadowOffset; + shadow.shadowBlurRadius = layer.shadowRadius; + } + return shadow; +} + - (void)viewDidMoveToWindow { // Subscribe to view bounds changed notification so that the view can be notified when a