RN: Support flexWrap: 'wrap-reverse'

Reviewed By: fkgozali

Differential Revision: D7684403

fbshipit-source-id: 6c247ba86b8ad1bb4dcc8f44f5609c939afe0f06
This commit is contained in:
Tim Yung 2018-04-19 15:42:49 -07:00 committed by Facebook Github Bot
parent 654435d1ed
commit d69e55060f
4 changed files with 9 additions and 3 deletions

View File

@ -432,7 +432,8 @@ var LayoutPropTypes = {
*/
flexWrap: ReactPropTypes.oneOf([
'wrap',
'nowrap'
'nowrap',
'wrap-reverse'
]),
/** `justifyContent` aligns children in the main direction.

View File

@ -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'

View File

@ -685,7 +685,8 @@ RCT_ENUM_CONVERTER(YGPositionType, (@{
RCT_ENUM_CONVERTER(YGWrap, (@{
@"wrap": @(YGWrapWrap),
@"nowrap": @(YGWrapNoWrap)
@"nowrap": @(YGWrapNoWrap),
@"wrap-reverse": @(YGWrapWrapReverse)
}), YGWrapNoWrap, intValue)
RCT_ENUM_CONVERTER(RCTPointerEvents, (@{

View File

@ -315,6 +315,10 @@ public class LayoutShadowNode extends ReactShadowNodeImpl {
setFlexWrap(YogaWrap.WRAP);
break;
}
case "wrap-reverse": {
setFlexWrap(YogaWrap.WRAP_REVERSE);
break;
}
default: {
throw new JSApplicationIllegalArgumentException(
"invalid value for flexWrap: " + flexWrap);