Fabric: ConcreteViewShadowNode::BaseShadowNode type alias

Summary:
@public
Just a type alias to make the code prettier, nothing more.

Reviewed By: mdvacca

Differential Revision: D8988383

fbshipit-source-id: 3f21de0ec0cb9a2270eccfc4a67a3d1108535e42
This commit is contained in:
Valentin Shergin 2018-08-04 09:30:22 -07:00 committed by Facebook Github Bot
parent 95074e6c12
commit ca6d263d6d
1 changed files with 9 additions and 8 deletions

View File

@ -43,17 +43,18 @@ class ConcreteViewShadowNode:
static_assert(std::is_base_of<AccessibilityProps, ViewPropsT>::value, "ViewPropsT must be a descendant of AccessibilityProps");
public:
using BaseShadowNode = ConcreteShadowNode<
concreteComponentName,
ViewPropsT,
ViewEventEmitterT
>;
using ConcreteViewProps = ViewPropsT;
using SharedConcreteViewProps = std::shared_ptr<const ViewPropsT>;
using ConcreteViewEventEmitter = ViewEventEmitterT;
using SharedConcreteViewEventEmitter = std::shared_ptr<const ViewEventEmitterT>;
using SharedConcreteViewShadowNode = std::shared_ptr<const ConcreteViewShadowNode>;
ConcreteViewShadowNode(
const ShadowNodeFragment &fragment,
const ShadowNodeCloneFunction &cloneFunction
):
ConcreteShadowNode<concreteComponentName, ViewPropsT, ViewEventEmitterT>(
BaseShadowNode(
fragment,
cloneFunction
),
@ -63,14 +64,14 @@ public:
YogaLayoutableShadowNode() {
YogaLayoutableShadowNode::setProps(*std::static_pointer_cast<const ConcreteViewProps>(fragment.props));
YogaLayoutableShadowNode::setChildren(ConcreteShadowNode<concreteComponentName, ViewPropsT, ViewEventEmitterT>::template getChildrenSlice<YogaLayoutableShadowNode>());
YogaLayoutableShadowNode::setChildren(BaseShadowNode::template getChildrenSlice<YogaLayoutableShadowNode>());
};
ConcreteViewShadowNode(
const SharedShadowNode &sourceShadowNode,
const ShadowNodeFragment &fragment
):
ConcreteShadowNode<concreteComponentName, ViewPropsT, ViewEventEmitterT>(
BaseShadowNode(
sourceShadowNode,
fragment
),
@ -87,7 +88,7 @@ public:
}
if (fragment.children) {
YogaLayoutableShadowNode::setChildren(ConcreteShadowNode<concreteComponentName, ViewPropsT, ViewEventEmitterT>::template getChildrenSlice<YogaLayoutableShadowNode>());
YogaLayoutableShadowNode::setChildren(BaseShadowNode::template getChildrenSlice<YogaLayoutableShadowNode>());
}
};