Expose getter for 'flex' property

Summary: Helps mitigate part of https://github.com/facebook/react-native/pull/12245 while we wait for a more comprehensive solution.

Reviewed By: emilsjolander

Differential Revision: D4571776

fbshipit-source-id: 185cd1b0d3af37724136a37471df412c2000dfe4
This commit is contained in:
Pieter De Baets 2017-03-13 05:58:09 -07:00 committed by Facebook Github Bot
parent 76f5b9606a
commit 41f3d0cf2d
2 changed files with 2 additions and 7 deletions

View File

@ -135,14 +135,13 @@ typedef void (^RCTApplierBlock)(NSDictionary<NSNumber *, UIView *> *viewRegistry
@property (nonatomic, assign) YGWrap flexWrap;
@property (nonatomic, assign) YGDisplay display;
@property (nonatomic, assign) float flex;
@property (nonatomic, assign) float flexGrow;
@property (nonatomic, assign) float flexShrink;
@property (nonatomic, assign) YGValue flexBasis;
@property (nonatomic, assign) float aspectRatio;
- (void)setFlex:(float)flex;
/**
* z-index, used to override sibling order in the view
*/

View File

@ -669,11 +669,6 @@ static inline YGSize RCTShadowViewMeasure(YGNodeRef node, float width, YGMeasure
// Flex
- (void)setFlex:(float)value
{
YGNodeStyleSetFlex(_yogaNode, value);
}
- (void)setFlexBasis:(YGValue)value
{
RCT_SET_YGVALUE_AUTO(value, YGNodeStyleSetFlexBasis, _yogaNode);
@ -694,6 +689,7 @@ static inline YGSize RCTShadowViewMeasure(YGNodeRef node, float width, YGMeasure
return YGNodeStyleGet##cssProp(_yogaNode); \
}
RCT_STYLE_PROPERTY(Flex, flex, Flex, float)
RCT_STYLE_PROPERTY(FlexGrow, flexGrow, FlexGrow, float)
RCT_STYLE_PROPERTY(FlexShrink, flexShrink, FlexShrink, float)
RCT_STYLE_PROPERTY(FlexDirection, flexDirection, FlexDirection, YGFlexDirection)