Skip to content

Commit 10678c4

Browse files
committed
move init of variable to if scope
1 parent 5a4a348 commit 10678c4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm

+2-2
Original file line numberDiff line numberDiff line change
@@ -269,12 +269,12 @@ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &
269269
_backedTextInputView.defaultTextAttributes[RCTAttributedStringEventEmitterKey];
270270
#endif
271271

272-
NSMutableParagraphStyle *paragraphStyle = defaultAttributes[NSParagraphStyleAttributeName];
273-
274272
if (!newTextInputProps.multiline) {
273+
NSMutableParagraphStyle *paragraphStyle = defaultAttributes[NSParagraphStyleAttributeName];
275274
paragraphStyle.lineBreakMode = NSLineBreakByTruncatingTail;
276275
defaultAttributes[NSParagraphStyleAttributeName] = paragraphStyle;
277276
}
277+
278278
_backedTextInputView.defaultTextAttributes = defaultAttributes;
279279
}
280280

0 commit comments

Comments
 (0)