Skip to content

Commit

Permalink
Expose getter for 'flex' property
Browse files Browse the repository at this point in the history
Summary: Helps mitigate part of facebook#12245 while we wait for a more comprehensive solution.

Reviewed By: emilsjolander

Differential Revision: D4571776

fbshipit-source-id: 185cd1b0d3af37724136a37471df412c2000dfe4
  • Loading branch information
javache authored and facebook-github-bot committed Mar 13, 2017
1 parent 76f5b96 commit 41f3d0c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
3 changes: 1 addition & 2 deletions React/Views/RCTShadowView.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
6 changes: 1 addition & 5 deletions React/Views/RCTShadowView.m
Original file line number Diff line number Diff line change
Expand Up @@ -669,11 +669,6 @@ - (void)setIntrinsicContentSize:(CGSize)intrinsicContentSize

// Flex

- (void)setFlex:(float)value
{
YGNodeStyleSetFlex(_yogaNode, value);
}

- (void)setFlexBasis:(YGValue)value
{
RCT_SET_YGVALUE_AUTO(value, YGNodeStyleSetFlexBasis, _yogaNode);
Expand All @@ -694,6 +689,7 @@ - (type)getProp \
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)
Expand Down

0 comments on commit 41f3d0c

Please sign in to comment.