Introducing "collapsable" prop as part of ViewProps

Summary: This diff introduces the collapsable props in the viewProps. This prop is used in product code to prevent specific Views to be removed from the view hierarchy

Reviewed By: shergin

Differential Revision: D10254679

fbshipit-source-id: 637665b8998a86e29e839eb6d405a0fac354c8d3
This commit is contained in:
David Vacca 2018-10-09 16:30:07 -07:00 committed by Facebook Github Bot
parent 04fbdd347b
commit 95afdd8bb3
3 changed files with 10 additions and 3 deletions

View File

@ -67,7 +67,12 @@ ViewProps::ViewProps(const ViewProps &sourceProps, const RawProps &rawProps)
pointerEvents(
convertRawProp(rawProps, "pointerEvents", sourceProps.pointerEvents)),
hitSlop(convertRawProp(rawProps, "hitSlop", sourceProps.hitSlop)),
onLayout(convertRawProp(rawProps, "onLayout", sourceProps.onLayout)){};
onLayout(convertRawProp(rawProps, "onLayout", sourceProps.onLayout)),
collapsable(convertRawProp(
rawProps,
"collapsable",
sourceProps.collapsable,
true)){};
#pragma mark - Convenience Methods

View File

@ -58,6 +58,8 @@ class ViewProps : public Props,
const EdgeInsets hitSlop{};
const bool onLayout{};
const bool collapsable{true};
#pragma mark - Convenience Methods
BorderMetrics resolveBorderMetrics(bool isRTL) const;