Fabric: YogaLayoutableShadowNode::setProps() was replaced with updateYogaProps()

Summary:
`YogaLayoutableShadowNode::setProps()` was renamed to `YogaLayoutableShadowNode::updateYogaProps()`. Now we don't need to pass an argument to this function because the object is already initialized. The new name also disambiguates this method with `getProp()` from `ShadowNode` (which does something completely different).

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D20052018

fbshipit-source-id: 4d9651bb4452408708fa1b36bb5c5c8639f7d1bb
This commit is contained in:
Valentin Shergin
2020-02-26 22:08:21 -08:00
committed by Facebook Github Bot
parent 124c20b2b1
commit 191d65ec4e
3 changed files with 8 additions and 6 deletions
@@ -118,7 +118,7 @@ protected:
// Set new props on node
const_cast<AndroidTextInputProps&>(textInputShadowNode->getConcreteProps()).yogaStyle.padding() = result;
// Communicate new props to Yoga part of the node
textInputShadowNode->setProps((YogaStylableProps)textInputShadowNode->getConcreteProps());
textInputShadowNode->updateYogaProps();
}
}
@@ -36,7 +36,7 @@ YogaLayoutableShadowNode::YogaLayoutableShadowNode(
yogaNode_(&initializeYogaConfig(yogaConfig_)) {
yogaNode_.setContext(this);
setProps(static_cast<YogaStylableProps const &>(*fragment.props));
updateYogaProps();
setChildren(YogaLayoutableShadowNode::getYogaLayoutableChildren());
}
@@ -58,7 +58,7 @@ YogaLayoutableShadowNode::YogaLayoutableShadowNode(
.yogaNode_.isDirty() == yogaNode_.isDirty());
if (fragment.props) {
setProps(dynamic_cast<YogaStylableProps const &>(*fragment.props));
updateYogaProps();
}
if (fragment.children) {
@@ -182,9 +182,11 @@ void YogaLayoutableShadowNode::setChildren(
yogaNode_.setDirty(!isClean);
}
void YogaLayoutableShadowNode::setProps(YogaStylableProps const &props) {
void YogaLayoutableShadowNode::updateYogaProps() {
ensureUnsealed();
auto props = static_cast<YogaStylableProps const &>(*props_);
// Resetting `dirty` flag only if `yogaStyle` portion of `Props` was changed.
if (!yogaNode_.isDirty() && (props.yogaStyle != yogaNode_.getStyle())) {
yogaNode_.setDirty(true);
@@ -59,9 +59,9 @@ class YogaLayoutableShadowNode : public LayoutableShadowNode {
void setChildren(YogaLayoutableShadowNode::UnsharedList children);
/*
* Sets Yoga styles based on given `YogaStylableProps`.
*
*/
void setProps(const YogaStylableProps &props);
void updateYogaProps();
/*
* Sets layoutable size of node.