diff --git a/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m b/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m index 34994ca4fd1..77d70d14c76 100644 --- a/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m +++ b/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m @@ -132,7 +132,9 @@ RCT_EXPORT_METHOD(setTextAndSelection : (nonnull NSNumber *)viewTag } RCTExecuteOnUIManagerQueue(^{ RCTBaseTextInputShadowView *shadowView = (RCTBaseTextInputShadowView *)[self.bridge.uiManager shadowViewForReactTag:viewTag]; - [shadowView setText:value]; + if (value) { + [shadowView setText:value]; + } [self.bridge.uiManager setNeedsLayout]; RCTExecuteOnMainQueue(^{ [view setSelectionStart:start selectionEnd:end]; diff --git a/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm b/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm index bbe622eebfc..589ff99ac7c 100644 --- a/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm @@ -420,7 +420,7 @@ using namespace facebook::react; return; } _comingFromJS = YES; - if (![value isEqualToString:_backedTextInputView.attributedText.string]) { + if (value && ![value isEqualToString:_backedTextInputView.attributedText.string]) { NSAttributedString *attributedString = [[NSAttributedString alloc] initWithString:value attributes:_backedTextInputView.defaultTextAttributes]; [self _setAttributedString:attributedString]; diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java index 0b6298fdd1f..9581583b6cb 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java @@ -288,16 +288,17 @@ public class ReactTextInputManager extends BaseViewManager