diff --git a/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts b/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts index 92fe7cdaf36bb3..f7a0de83adc47d 100644 --- a/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts +++ b/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts @@ -40,6 +40,7 @@ export interface FlexStyle { | 'stretch' | 'space-between' | 'space-around' + | 'space-evenly' | undefined; alignItems?: FlexAlignType | undefined; alignSelf?: 'auto' | FlexAlignType | undefined; diff --git a/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.js b/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.js index fb2db1c4c60e31..c4f45c7e61c6b1 100644 --- a/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.js +++ b/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.js @@ -552,7 +552,8 @@ type ____LayoutStyle_Internal = $ReadOnly<{ | 'center' | 'stretch' | 'space-between' - | 'space-around', + | 'space-around' + | 'space-evenly', /** `overflow` controls how children are measured and displayed. * `overflow: hidden` causes views to be clipped while `overflow: scroll` diff --git a/packages/react-native/React/Base/RCTConvert.m b/packages/react-native/React/Base/RCTConvert.m index 34822463593f8f..55f42ebf49e9e3 100644 --- a/packages/react-native/React/Base/RCTConvert.m +++ b/packages/react-native/React/Base/RCTConvert.m @@ -1172,7 +1172,8 @@ + (NSPropertyList)NSPropertyList:(id)json @"stretch" : @(YGAlignStretch), @"baseline" : @(YGAlignBaseline), @"space-between" : @(YGAlignSpaceBetween), - @"space-around" : @(YGAlignSpaceAround) + @"space-around" : @(YGAlignSpaceAround), + @"space-evenly" : @(YGAlignSpaceEvenly) }), YGAlignFlexStart, intValue) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/LayoutShadowNode.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/LayoutShadowNode.java index 46b833a053a2dc..6513dd6268cc67 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/LayoutShadowNode.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/LayoutShadowNode.java @@ -541,6 +541,11 @@ public void setAlignContent(@Nullable String alignContent) { setAlignContent(YogaAlign.SPACE_AROUND); return; } + case "space-evenly": + { + setAlignContent(YogaAlign.SPACE_EVENLY); + return; + } default: { FLog.w(ReactConstants.TAG, "invalid value for alignContent: " + alignContent); diff --git a/packages/react-native/ReactCommon/react/renderer/components/view/conversions.h b/packages/react-native/ReactCommon/react/renderer/components/view/conversions.h index 49662454c9242a..5c4bbbfc04fc5f 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/view/conversions.h +++ b/packages/react-native/ReactCommon/react/renderer/components/view/conversions.h @@ -284,6 +284,10 @@ inline void fromRawValue( result = yoga::Align::SpaceAround; return; } + if (stringValue == "space-evenly") { + result = yoga::Align::SpaceEvenly; + return; + } LOG(ERROR) << "Could not parse yoga::Align:" << stringValue; react_native_expect(false); }