Skip to content

Commit b5aaa25

Browse files
sherginfacebook-github-bot
authored andcommitted
Fabric: De-virtualizing LayoutableShadowNode::setLayoutMetrics()
Summary: Removing `virtual` qualifier for `LayoutableShadowNode::setLayoutMetrics()`. Original design implied that some subclass might override that method to provide additional functionality but we never used that and seems not it does not much the overall design: we store `layoutMetrics` *inside* `LayoutableShadowNode`. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20268042 fbshipit-source-id: 2aa9b3da316b97f26493fb04d19ca8290bd5d2a6
1 parent 2a61c4e commit b5aaa25

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

ReactCommon/fabric/core/layout/LayoutableShadowNode.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ class LayoutableShadowNode : public ShadowNode {
9898
LayoutableShadowNode const &ancestorLayoutableShadowNode,
9999
LayoutInspectingPolicy policy) const;
100100

101+
/*
102+
* Sets layout metrics for the shadow node.
103+
* Returns true if the metrics are different from previous ones.
104+
*/
105+
bool setLayoutMetrics(LayoutMetrics layoutMetrics);
106+
101107
/*
102108
* Returns the ShadowNode that is rendered at the Point received as a
103109
* parameter.
@@ -140,12 +146,6 @@ class LayoutableShadowNode : public ShadowNode {
140146
*/
141147
LayoutableShadowNode::UnsharedList getLayoutableChildNodes() const;
142148

143-
/*
144-
* Sets layout metrics for the shadow node.
145-
* Returns true if the metrics are different from previous ones.
146-
*/
147-
virtual bool setLayoutMetrics(LayoutMetrics layoutMetrics);
148-
149149
#pragma mark - DebugStringConvertible
150150

151151
#if RN_DEBUG_STRING_CONVERTIBLE

ReactCommon/fabric/core/tests/TestComponent.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ class TestShadowNode : public ConcreteViewShadowNode<
5555

5656
Transform _transform{Transform::Identity()};
5757

58-
bool setLayoutMetrics(LayoutMetrics layoutMetrics) override {
59-
return YogaLayoutableShadowNode::setLayoutMetrics(layoutMetrics);
60-
}
61-
6258
Transform getTransform() const override {
6359
return _transform;
6460
}

0 commit comments

Comments
 (0)