diff --git a/React/Fabric/Mounting/RCTComponentViewDescriptor.h b/React/Fabric/Mounting/RCTComponentViewDescriptor.h index 1642c2bc51d..b77f04d23cb 100644 --- a/React/Fabric/Mounting/RCTComponentViewDescriptor.h +++ b/React/Fabric/Mounting/RCTComponentViewDescriptor.h @@ -21,7 +21,7 @@ class RCTComponentViewDescriptor final { /* * Associated (and owned) native view instance. */ - UIView *view; + __strong UIView *view = nil; /* * Indicates a requirement to call on the view methods from diff --git a/React/Fabric/Mounting/RCTMountingManager.mm b/React/Fabric/Mounting/RCTMountingManager.mm index e0096438ff1..060eda9043c 100644 --- a/React/Fabric/Mounting/RCTMountingManager.mm +++ b/React/Fabric/Mounting/RCTMountingManager.mm @@ -46,7 +46,7 @@ static void RNDeleteMountInstruction( SurfaceId surfaceId) { auto const &oldChildShadowView = mutation.oldChildShadowView; - RCTComponentViewDescriptor componentViewDescriptor = [registry componentViewDescriptorWithTag:oldChildShadowView.tag]; + auto const &componentViewDescriptor = [registry componentViewDescriptorWithTag:oldChildShadowView.tag]; observerCoordinator.unregisterViewComponentDescriptor(componentViewDescriptor, surfaceId); [registry enqueueComponentViewWithComponentHandle:oldChildShadowView.componentHandle tag:oldChildShadowView.tag