diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm index 228ec0d2a28f..f511fcc36154 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm @@ -137,7 +137,6 @@ - (void)updateState:(const State::Shared &)state oldState:(const State::Shared & { _textView.state = std::static_pointer_cast(state); [_textView setNeedsDisplay]; - [self setNeedsLayout]; // If the attributed string has changed, we need to notify the accessibility system that something changed, // otherwise it may hold on to stale values (this happens most often when an element is updated async) @@ -158,9 +157,15 @@ - (void)updateLayoutMetrics:(const LayoutMetrics &)layoutMetrics // re-applying individual sub-values which weren't changed. [super updateLayoutMetrics:layoutMetrics oldLayoutMetrics:_layoutMetrics]; _textView.layoutMetrics = _layoutMetrics; - _textLayoutFrame = RCTCGRectFromRect(_layoutMetrics.getContentFrame()); [_textView setNeedsDisplay]; - [self setNeedsLayout]; +} + +- (void)finalizeUpdates:(RNComponentViewUpdateMask)updateMask +{ + [super finalizeUpdates:updateMask]; + if (updateMask & (RNComponentViewUpdateMaskState | RNComponentViewUpdateMaskLayoutMetrics)) { + [self _updateTextViewFrame]; + } } - (void)prepareForRecycle @@ -170,10 +175,8 @@ - (void)prepareForRecycle _accessibilityProvider = nil; } -- (void)layoutSubviews +- (void)_updateTextViewFrame { - [super layoutSubviews]; - CGRect textViewFrame = self.bounds; CGRect drawingFrame = RCTCGRectFromRect(_layoutMetrics.getContentFrame());