/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include #include #include #include namespace facebook { namespace react { /* * This is an implementation detail, do not use it directly. * A type-erased version of `Element<>`. * `ElementFragment` carries all information that is stored inside `Element<>` * in some generalized, type-erased manner. */ class ElementFragment final { public: using Shared = std::shared_ptr; using List = std::vector; using ListOfShared = std::vector; using ReferenceCallback = std::function; using FinalizeCallback = std::function; using StateCallback = std::function; /* * ComponentDescriptor part (describes the type) */ ComponentHandle componentHandle; ComponentName componentName; /* * ShadowNodeFamily part (describes the family) */ Tag tag; SurfaceId surfaceId; /* * ShadowNode part (describes the instance) */ Props::Shared props; List children; /* * Other */ ReferenceCallback referenceCallback; FinalizeCallback finalizeCallback; StateCallback stateCallback; }; } // namespace react } // namespace facebook