Fabric: YogaStylableProps now inherits Props
Summary: How we can finally make `ViewProps` inherit `YogaStylableProps` and remove `dynamic_cast`. This overall change is aligned with D19963353. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20052026 fbshipit-source-id: 1066f9a259b50d4672111c9c03a71c2590d59aca
This commit is contained in:
Родитель
6d10310733
Коммит
33bf310920
|
@ -19,8 +19,7 @@ namespace facebook {
|
|||
namespace react {
|
||||
|
||||
ViewProps::ViewProps(ViewProps const &sourceProps, RawProps const &rawProps)
|
||||
: Props(sourceProps, rawProps),
|
||||
YogaStylableProps(sourceProps, rawProps),
|
||||
: YogaStylableProps(sourceProps, rawProps),
|
||||
AccessibilityProps(sourceProps, rawProps),
|
||||
opacity(
|
||||
convertRawProp(rawProps, "opacity", sourceProps.opacity, (Float)1.0)),
|
||||
|
|
|
@ -23,9 +23,7 @@ class ViewProps;
|
|||
|
||||
using SharedViewProps = std::shared_ptr<ViewProps const>;
|
||||
|
||||
class ViewProps : public Props,
|
||||
public YogaStylableProps,
|
||||
public AccessibilityProps {
|
||||
class ViewProps : public YogaStylableProps, public AccessibilityProps {
|
||||
public:
|
||||
ViewProps() = default;
|
||||
ViewProps(ViewProps const &sourceProps, RawProps const &rawProps);
|
||||
|
|
|
@ -36,7 +36,7 @@ YogaLayoutableShadowNode::YogaLayoutableShadowNode(
|
|||
yogaNode_(&initializeYogaConfig(yogaConfig_)) {
|
||||
yogaNode_.setContext(this);
|
||||
|
||||
setProps(dynamic_cast<YogaStylableProps const &>(*fragment.props));
|
||||
setProps(static_cast<YogaStylableProps const &>(*fragment.props));
|
||||
setChildren(YogaLayoutableShadowNode::getYogaLayoutableChildren());
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,8 @@ namespace react {
|
|||
YogaStylableProps::YogaStylableProps(
|
||||
YogaStylableProps const &sourceProps,
|
||||
RawProps const &rawProps)
|
||||
: yogaStyle(convertRawProp(rawProps, sourceProps.yogaStyle)){};
|
||||
: Props(sourceProps, rawProps),
|
||||
yogaStyle(convertRawProp(rawProps, sourceProps.yogaStyle)){};
|
||||
|
||||
#pragma mark - DebugStringConvertible
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
class YogaStylableProps {
|
||||
class YogaStylableProps : public Props {
|
||||
public:
|
||||
YogaStylableProps() = default;
|
||||
YogaStylableProps(
|
||||
|
|
Загрузка…
Ссылка в новой задаче