mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Log soft exception instead of crashing if ref is null on TextInput onPress
Summary: See title. Changelog: [internal] Reviewed By: yungsters Differential Revision: D29410457 fbshipit-source-id: 0b9a9836baa0b5b7deb88cd73f4f634ca10c5868
This commit is contained in:
1 parent
b673e352fb
commit
afafbf8ec4
1 file changed
+3
-1
@@ -1073,7 +1073,9 @@ function InternalTextInput(props: Props): React.Node {
|
||||
() => ({
|
||||
onPress: (event: PressEvent) => {
|
||||
if (props.editable !== false) {
|
||||
nullthrows(inputRef.current).focus();
|
||||
if (inputRef.current != null) {
|
||||
inputRef.current.focus();
|
||||
}
|
||||
}
|
||||
},
|
||||
onPressIn: props.onPressIn,
|
||||
|
||||
Reference in new issue
Block a user