Fix layer.mask not being reset after recycle

Summary:
Changelog: [Internal]

If `layer.mask` was set and the view got reused without having a different `layer.mask`, this value would persist between reuses.

I also added a call to `super finalizeUpdates` as it is best practice to call super, the parent class right now doesn't do anything but in the future we might add there some default logic.

Reviewed By: shergin

Differential Revision: D20030174

fbshipit-source-id: c90be3f4e9a8f3814000f177a3d50061f5aa120c
This commit is contained in:
Samuel Susla
2020-02-25 07:04:58 -08:00
committed by Facebook Github Bot
parent 2e2b331db5
commit af5ecb2916
@@ -267,6 +267,7 @@ using namespace facebook::react;
- (void)finalizeUpdates:(RNComponentViewUpdateMask)updateMask
{
[super finalizeUpdates:updateMask];
if (!_needsInvalidateLayer) {
return;
}
@@ -399,6 +400,7 @@ static RCTBorderStyle RCTBorderStyleFromBorderStyle(BorderStyle borderStyle)
colorComponentsFromColor(borderMetrics.borderColors.left).alpha == 0 || self.clipsToBounds);
if (useCoreAnimationBorderRendering) {
layer.mask = nil;
if (_borderLayer) {
[_borderLayer removeFromSuperlayer];
_borderLayer = nil;