@@ -27,6 +27,7 @@ - (instancetype)init
2727 _maxFontSizeMultiplier = NAN;
2828 _alignment = NSTextAlignmentNatural;
2929 _baseWritingDirection = NSWritingDirectionNatural;
30+ _lineBreakStrategy = NSLineBreakStrategyNone;
3031 _textShadowRadius = NAN;
3132 _opacity = NAN;
3233 _textTransform = RCTTextTransformUndefined;
@@ -66,6 +67,7 @@ - (void)applyTextAttributes:(RCTTextAttributes *)textAttributes
6667 _baseWritingDirection = textAttributes->_baseWritingDirection != NSWritingDirectionNatural
6768 ? textAttributes->_baseWritingDirection
6869 : _baseWritingDirection; // *
70+ _lineBreakStrategy = textAttributes->_lineBreakStrategy ?: _lineBreakStrategy;
6971
7072 // Decoration
7173 _textDecorationColor = textAttributes->_textDecorationColor ?: _textDecorationColor;
@@ -117,6 +119,13 @@ - (NSParagraphStyle *)effectiveParagraphStyle
117119 isParagraphStyleUsed = YES ;
118120 }
119121
122+ if (_lineBreakStrategy != NSLineBreakStrategyNone) {
123+ if (@available (iOS 14.0 , *)) {
124+ paragraphStyle.lineBreakStrategy = _lineBreakStrategy;
125+ isParagraphStyleUsed = YES ;
126+ }
127+ }
128+
120129 if (!isnan (_lineHeight)) {
121130 CGFloat lineHeight = _lineHeight * self.effectiveFontSizeMultiplier ;
122131 paragraphStyle.minimumLineHeight = lineHeight;
@@ -318,7 +327,7 @@ - (BOOL)isEqual:(RCTTextAttributes *)textAttributes
318327 RCTTextAttributesCompareFloats (_letterSpacing) &&
319328 // Paragraph Styles
320329 RCTTextAttributesCompareFloats (_lineHeight) && RCTTextAttributesCompareFloats (_alignment) &&
321- RCTTextAttributesCompareOthers (_baseWritingDirection) &&
330+ RCTTextAttributesCompareOthers (_baseWritingDirection) && RCTTextAttributesCompareOthers (_lineBreakStrategy) &&
322331 // Decoration
323332 RCTTextAttributesCompareObjects (_textDecorationColor) && RCTTextAttributesCompareOthers (_textDecorationStyle) &&
324333 RCTTextAttributesCompareOthers (_textDecorationLine) &&
0 commit comments