diff --git a/native/chat/compose-subchannel.react.js b/native/chat/compose-subchannel.react.js --- a/native/chat/compose-subchannel.react.js +++ b/native/chat/compose-subchannel.react.js @@ -69,8 +69,7 @@ const tagInputRef = React.useRef(); const onUnknownErrorAlertAcknowledged = React.useCallback(() => { setUsernameInputText(''); - invariant(tagInputRef.current, 'tagInput should be set'); - tagInputRef.current.focus(); + tagInputRef.current?.focus(); }, []); const waitingOnThreadIDRef = React.useRef(); diff --git a/native/chat/settings/add-users-modal.react.js b/native/chat/settings/add-users-modal.react.js --- a/native/chat/settings/add-users-modal.react.js +++ b/native/chat/settings/add-users-modal.react.js @@ -1,6 +1,5 @@ // @flow -import invariant from 'invariant'; import * as React from 'react'; import { View, Text, ActivityIndicator, Alert } from 'react-native'; @@ -62,8 +61,7 @@ const onUnknownErrorAlertAcknowledged = React.useCallback(() => { setUsernameInputText(''); setUserInfoInputArray([]); - invariant(tagInputRef.current, 'tagInput should be set'); - tagInputRef.current.focus(); + tagInputRef.current?.focus(); }, []); const { navigation } = props; diff --git a/native/profile/relationship-list.react.js b/native/profile/relationship-list.react.js --- a/native/profile/relationship-list.react.js +++ b/native/profile/relationship-list.react.js @@ -205,8 +205,7 @@ const onUnknownErrorAlertAcknowledged = React.useCallback(() => { setCurrentTags([]); setSearchInputText(''); - invariant(tagInputRef.current, 'tagInput should be set'); - tagInputRef.current.focus(); + tagInputRef.current?.focus(); }, []); const callUpdateRelationships = useServerCall(updateRelationships);