From bc9d50991a84c30c7d73f359fc3edbdbbfbfa40c Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Thu, 19 Dec 2019 13:45:35 -0800 Subject: [PATCH] ShadowNodeFamily now accepts fragment in constructor Summary: `ShadowNodeFamily` now accepts ShadowNodeFamilyfragment as its constructor parameter. Changelog: [Internal] Reviewed By: shergin Differential Revision: D19115794 fbshipit-source-id: 95605398a8f6b54b5c6f196a22b8b6cadb18baad --- ReactCommon/fabric/core/shadownode/ShadowNode.cpp | 6 +++--- .../fabric/core/shadownode/ShadowNodeFamily.cpp | 10 ++++------ ReactCommon/fabric/core/shadownode/ShadowNodeFamily.h | 5 ++--- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/ReactCommon/fabric/core/shadownode/ShadowNode.cpp b/ReactCommon/fabric/core/shadownode/ShadowNode.cpp index 453c2227797..3f10dd555c4 100644 --- a/ReactCommon/fabric/core/shadownode/ShadowNode.cpp +++ b/ReactCommon/fabric/core/shadownode/ShadowNode.cpp @@ -45,9 +45,9 @@ ShadowNode::ShadowNode( : emptySharedShadowNodeSharedList()), state_(fragment.state), family_(std::make_shared( - fragment.tag, - fragment.surfaceId, - fragment.eventEmitter, + ShadowNodeFamilyFragment{fragment.tag, + fragment.surfaceId, + fragment.eventEmitter}, componentDescriptor)), traits_(traits) { assert(props_); diff --git a/ReactCommon/fabric/core/shadownode/ShadowNodeFamily.cpp b/ReactCommon/fabric/core/shadownode/ShadowNodeFamily.cpp index bc72bc0e34d..30a74b54a00 100644 --- a/ReactCommon/fabric/core/shadownode/ShadowNodeFamily.cpp +++ b/ReactCommon/fabric/core/shadownode/ShadowNodeFamily.cpp @@ -13,13 +13,11 @@ namespace facebook { namespace react { ShadowNodeFamily::ShadowNodeFamily( - Tag tag, - SurfaceId surfaceId, - SharedEventEmitter const &eventEmitter, + ShadowNodeFamilyFragment const &fragment, ComponentDescriptor const &componentDescriptor) - : tag_(tag), - surfaceId_(surfaceId), - eventEmitter_(eventEmitter), + : tag_(fragment.tag), + surfaceId_(fragment.surfaceId), + eventEmitter_(fragment.eventEmitter), componentDescriptor_(componentDescriptor), componentHandle_(componentDescriptor.getComponentHandle()), componentName_(componentDescriptor.getComponentName()) {} diff --git a/ReactCommon/fabric/core/shadownode/ShadowNodeFamily.h b/ReactCommon/fabric/core/shadownode/ShadowNodeFamily.h index f268f98b26a..43500a88767 100644 --- a/ReactCommon/fabric/core/shadownode/ShadowNodeFamily.h +++ b/ReactCommon/fabric/core/shadownode/ShadowNodeFamily.h @@ -11,6 +11,7 @@ #include #include +#include namespace facebook { namespace react { @@ -27,9 +28,7 @@ class ShadowNodeFamily { using Weak = std::weak_ptr; ShadowNodeFamily( - Tag tag, - SurfaceId surfaceId, - SharedEventEmitter const &eventEmitter, + ShadowNodeFamilyFragment const &fragment, ComponentDescriptor const &componentDescriptor); /*