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:
Joshua Gross authored and Facebook GitHub Bot committed 2021-06-25 19:49:04 -07:00
1 parent b673e352fb
commit afafbf8ec4
1 file changed
+3 -1
+3 -1
View File
@@ -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,