diff --git a/ReactCommon/fabric/components/view/ConcreteViewShadowNode.h b/ReactCommon/fabric/components/view/ConcreteViewShadowNode.h index fb1228b75d8..209a8594051 100644 --- a/ReactCommon/fabric/components/view/ConcreteViewShadowNode.h +++ b/ReactCommon/fabric/components/view/ConcreteViewShadowNode.h @@ -14,6 +14,7 @@ #include #include #include +#include #include namespace facebook { diff --git a/ReactCommon/fabric/core/componentdescriptor/ConcreteComponentDescriptor.h b/ReactCommon/fabric/core/componentdescriptor/ConcreteComponentDescriptor.h index 31a0fb62379..0ec1cba19f1 100644 --- a/ReactCommon/fabric/core/componentdescriptor/ConcreteComponentDescriptor.h +++ b/ReactCommon/fabric/core/componentdescriptor/ConcreteComponentDescriptor.h @@ -13,6 +13,8 @@ #include #include #include +#include +#include namespace facebook { namespace react { diff --git a/ReactCommon/fabric/core/shadownode/ShadowNode.cpp b/ReactCommon/fabric/core/shadownode/ShadowNode.cpp index 9fdb725afaf..2fc759237ae 100644 --- a/ReactCommon/fabric/core/shadownode/ShadowNode.cpp +++ b/ReactCommon/fabric/core/shadownode/ShadowNode.cpp @@ -9,6 +9,7 @@ #include +#include #include #include diff --git a/ReactCommon/fabric/core/shadownode/ShadowNode.h b/ReactCommon/fabric/core/shadownode/ShadowNode.h index 762f1ef7e2b..dca542b3f62 100644 --- a/ReactCommon/fabric/core/shadownode/ShadowNode.h +++ b/ReactCommon/fabric/core/shadownode/ShadowNode.h @@ -21,6 +21,8 @@ namespace facebook { namespace react { +struct ShadowNodeFragment; + class ShadowNode; using SharedShadowNode = std::shared_ptr; @@ -29,15 +31,6 @@ using SharedShadowNodeList = std::vector>; using SharedShadowNodeSharedList = std::shared_ptr; using SharedShadowNodeUnsharedList = std::shared_ptr; -struct ShadowNodeFragment { - Tag tag; - Tag rootTag; - SharedProps props; - SharedEventEmitter eventEmitter; - SharedShadowNodeSharedList children; - SharedLocalData localData; -}; - using ShadowNodeCloneFunction = std::function +#include +#include +#include +#include + +namespace facebook { +namespace react { + +/* + * An object which supposed to be used as a parameter specifying a shape + * of created or cloned ShadowNode. + * Note: Most of the fields are `const &` references (essentially just raw + * pointers) which means that the Fragment does not copy/store them or + * retain ownership of them. + */ +struct ShadowNodeFragment { + Tag tag = 0; + Tag rootTag = 0; + const SharedProps &props = nullSharedProps(); + const SharedEventEmitter &eventEmitter = nullSharedEventEmitter(); + const SharedShadowNodeSharedList &children = nullSharedChildren(); + const SharedLocalData &localData = nullLocalData(); + +private: + static SharedProps &nullSharedProps(); + static SharedEventEmitter &nullSharedEventEmitter(); + static SharedShadowNodeSharedList &nullSharedChildren(); + static SharedLocalData &nullLocalData(); +}; + +} // namespace react +} // namespace facebook diff --git a/ReactCommon/fabric/uimanager/FabricUIManager.cpp b/ReactCommon/fabric/uimanager/FabricUIManager.cpp index 1ecd1b25b85..11f6b362d64 100644 --- a/ReactCommon/fabric/uimanager/FabricUIManager.cpp +++ b/ReactCommon/fabric/uimanager/FabricUIManager.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include