Skip to content

Commit

Permalink
RN: Support flexWrap: 'wrap-reverse'
Browse files Browse the repository at this point in the history
Reviewed By: fkgozali

Differential Revision: D7684403

fbshipit-source-id: 6c247ba86b8ad1bb4dcc8f44f5609c939afe0f06
  • Loading branch information
yungsters authored and facebook-github-bot committed Apr 19, 2018
1 parent 654435d commit d69e550
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Libraries/StyleSheet/LayoutPropTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,8 @@ var LayoutPropTypes = {
*/
flexWrap: ReactPropTypes.oneOf([
'wrap',
'nowrap'
'nowrap',
'wrap-reverse'
]),

/** `justifyContent` aligns children in the main direction.
Expand Down
2 changes: 1 addition & 1 deletion Libraries/StyleSheet/StyleSheetTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export type ____LayoutStyle_Internal = $ReadOnly<{|
borderTopWidth?: number,
position?: 'absolute' | 'relative',
flexDirection?: 'row' | 'row-reverse' | 'column' | 'column-reverse',
flexWrap?: 'wrap' | 'nowrap',
flexWrap?: 'wrap' | 'nowrap' | 'wrap-reverse',
justifyContent?:
| 'flex-start'
| 'flex-end'
Expand Down
3 changes: 2 additions & 1 deletion React/Base/RCTConvert.m
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,8 @@ + (NSPropertyList)NSPropertyList:(id)json

RCT_ENUM_CONVERTER(YGWrap, (@{
@"wrap": @(YGWrapWrap),
@"nowrap": @(YGWrapNoWrap)
@"nowrap": @(YGWrapNoWrap),
@"wrap-reverse": @(YGWrapWrapReverse)
}), YGWrapNoWrap, intValue)

RCT_ENUM_CONVERTER(RCTPointerEvents, (@{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,10 @@ public void setFlexWrap(@Nullable String flexWrap) {
setFlexWrap(YogaWrap.WRAP);
break;
}
case "wrap-reverse": {
setFlexWrap(YogaWrap.WRAP_REVERSE);
break;
}
default: {
throw new JSApplicationIllegalArgumentException(
"invalid value for flexWrap: " + flexWrap);
Expand Down

0 comments on commit d69e550

Please sign in to comment.