Skip to content

Commit

Permalink
Log soft exception instead of crashing if ref is null on TextInput on…
Browse files Browse the repository at this point in the history
…Press

Summary:
See title.

Changelog: [internal]

Reviewed By: yungsters

Differential Revision: D29410457

fbshipit-source-id: 0b9a9836baa0b5b7deb88cd73f4f634ca10c5868
  • Loading branch information
JoshuaGross authored and facebook-github-bot committed Jun 26, 2021
1 parent b673e35 commit afafbf8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Libraries/Components/TextInput/TextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit afafbf8

Please sign in to comment.