Skip to content

Commit 17e555d

Browse files
committed
move init of variable to if scope
1 parent 57cc167 commit 17e555d

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
@@ -265,12 +265,12 @@ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &
265265
defaultAttributes[RCTAttributedStringEventEmitterKey] =
266266
_backedTextInputView.defaultTextAttributes[RCTAttributedStringEventEmitterKey];
267267

268-
NSMutableParagraphStyle *paragraphStyle = defaultAttributes[NSParagraphStyleAttributeName];
269-
270268
if (!newTextInputProps.multiline) {
269+
NSMutableParagraphStyle *paragraphStyle = defaultAttributes[NSParagraphStyleAttributeName];
271270
paragraphStyle.lineBreakMode = NSLineBreakByTruncatingTail;
272271
defaultAttributes[NSParagraphStyleAttributeName] = paragraphStyle;
273272
}
273+
274274
_backedTextInputView.defaultTextAttributes = defaultAttributes;
275275
}
276276

0 commit comments

Comments
 (0)