mirror of
https://github.com/status-im/react-native.git
synced 2025-01-09 09:12:02 +00:00
2bb41031ba
Summary: `RootShadowNode` is a dedicated class for managing the root node. Reviewed By: mdvacca Differential Revision: D7857050 fbshipit-source-id: f15f4b177f03cea4c0fd5a60d761ee2745319d77
51 lines
1.1 KiB
C++
51 lines
1.1 KiB
C++
/**
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
*
|
|
* 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 <memory>
|
|
|
|
#include <fabric/core/LayoutContext.h>
|
|
#include <fabric/view/RootProps.h>
|
|
#include <fabric/view/ConcreteViewShadowNode.h>
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
class RootShadowNode;
|
|
|
|
using SharedRootShadowNode = std::shared_ptr<const RootShadowNode>;
|
|
using UnsharedRootShadowNode = std::shared_ptr<RootShadowNode>;
|
|
|
|
/*
|
|
* `ShadowNode` for the root component.
|
|
* Besides all functionality of the `View` component, `RootShadowNode` contains
|
|
* props which represent external layout constraints and context of the
|
|
* shadow tree.
|
|
*/
|
|
class RootShadowNode final:
|
|
public ConcreteViewShadowNode<RootProps> {
|
|
|
|
public:
|
|
|
|
using ConcreteViewShadowNode::ConcreteViewShadowNode;
|
|
|
|
ComponentName getComponentName() const override;
|
|
|
|
/*
|
|
* Layouts the shadow tree.
|
|
*/
|
|
void layout();
|
|
|
|
private:
|
|
|
|
using YogaLayoutableShadowNode::layout;
|
|
};
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|