diff --git a/app/components/emoji_picker/sections/index.tsx b/app/components/emoji_picker/sections/index.tsx index cbb7748932..ea7309cb39 100644 --- a/app/components/emoji_picker/sections/index.tsx +++ b/app/components/emoji_picker/sections/index.tsx @@ -75,7 +75,7 @@ CategoryNames.forEach((name: string) => { const EmojiSections = ({customEmojis, customEmojisEnabled, onEmojiPress, recentEmojis, skinTone, width}: Props) => { const serverUrl = useServerUrl(); - const list = useRef>(); + const list = useRef>(null); const [sectionIndex, setSectionIndex] = useState(0); const [customEmojiPage, setCustomEmojiPage] = useState(0); const [fetchingCustomEmojis, setFetchingCustomEmojis] = useState(false); @@ -221,8 +221,6 @@ const EmojiSections = ({customEmojis, customEmojisEnabled, onEmojiPress, recentE onEndReached={onLoadMoreCustomEmojis} onEndReachedThreshold={2} onScroll={onScroll} - - // @ts-expect-error ref ref={list} renderItem={renderItem} renderSectionHeader={renderSectionHeader} diff --git a/app/screens/apps_form/apps_form_component.tsx b/app/screens/apps_form/apps_form_component.tsx index 64fa53c391..77be9e71ef 100644 --- a/app/screens/apps_form/apps_form_component.tsx +++ b/app/screens/apps_form/apps_form_component.tsx @@ -115,7 +115,7 @@ function AppsFormComponent({ submit, performLookupCall, }: Props) { - const scrollView = useRef(); + const scrollView = useRef(null); const [submitting, setSubmitting] = useState(false); const intl = useIntl(); const serverUrl = useServerUrl(); @@ -388,8 +388,6 @@ function AppsFormComponent({ style={style.container} > diff --git a/app/screens/create_or_edit_channel/channel_info_form.tsx b/app/screens/create_or_edit_channel/channel_info_form.tsx index 1965f0ece1..17cec65bf7 100644 --- a/app/screens/create_or_edit_channel/channel_info_form.tsx +++ b/app/screens/create_or_edit_channel/channel_info_form.tsx @@ -118,7 +118,7 @@ export default function ChannelInfoForm({ const purposeInput = useRef(null); const headerInput = useRef(null); - const scrollViewRef = useRef(); + const scrollViewRef = useRef(null); const updateScrollTimeout = useRef(); @@ -230,8 +230,6 @@ export default function ChannelInfoForm({ > (); + const keyboardAwareRef = useRef(null); const changedProfilePicture = useRef(undefined); const scrollViewRef = useRef(); const hasUpdateUserInfo = useRef(false); @@ -236,8 +236,6 @@ const EditProfile = ({ keyboardOpeningTime={0} keyboardDismissMode='on-drag' keyboardShouldPersistTaps='handled' - - // @ts-expect-error legacy ref ref={keyboardAwareRef} scrollToOverflowEnabled={true} testID='edit_profile.scroll_view' diff --git a/app/screens/edit_server/form.tsx b/app/screens/edit_server/form.tsx index 43fe2289ed..8c29b38cad 100644 --- a/app/screens/edit_server/form.tsx +++ b/app/screens/edit_server/form.tsx @@ -24,7 +24,7 @@ type Props = { displayNameError?: string; handleUpdate: () => void; handleDisplayNameTextChanged: (text: string) => void; - keyboardAwareRef: MutableRefObject; + keyboardAwareRef: MutableRefObject; serverUrl: string; theme: Theme; }; diff --git a/app/screens/edit_server/index.tsx b/app/screens/edit_server/index.tsx index ee2b43cb2c..8d61a9c562 100644 --- a/app/screens/edit_server/index.tsx +++ b/app/screens/edit_server/index.tsx @@ -42,7 +42,7 @@ const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => ({ const EditServer = ({closeButtonId, componentId, server, theme}: ServerProps) => { const {formatMessage} = useIntl(); - const keyboardAwareRef = useRef(); + const keyboardAwareRef = useRef(null); const [saving, setSaving] = useState(false); const [displayName, setDisplayName] = useState(server.displayName); const [buttonDisabled, setButtonDisabled] = useState(true); @@ -110,8 +110,6 @@ const EditServer = ({closeButtonId, componentId, server, theme}: ServerProps) => extraScrollHeight={20} keyboardDismissMode='on-drag' keyboardShouldPersistTaps='handled' - - // @ts-expect-error legacy ref ref={keyboardAwareRef} scrollToOverflowEnabled={true} style={styles.flex} diff --git a/app/screens/forgot_password/index.tsx b/app/screens/forgot_password/index.tsx index 40522168c5..cd88468781 100644 --- a/app/screens/forgot_password/index.tsx +++ b/app/screens/forgot_password/index.tsx @@ -95,7 +95,7 @@ const ForgotPassword = ({serverUrl, theme}: Props) => { const [error, setError] = useState(''); const [isPasswordLinkSent, setIsPasswordLinkSent] = useState(false); const {formatMessage} = useIntl(); - const keyboardAwareRef = useRef(); + const keyboardAwareRef = useRef(null); const styles = getStyleSheet(theme); const changeEmail = useCallback((emailAddress: string) => { @@ -192,8 +192,6 @@ const ForgotPassword = ({serverUrl, theme}: Props) => { extraScrollHeight={0} keyboardDismissMode='on-drag' keyboardShouldPersistTaps='handled' - - // @ts-expect-error legacy ref ref={keyboardAwareRef} scrollToOverflowEnabled={true} style={styles.flex} diff --git a/app/screens/home/channel_list/servers/servers_list/server_item/server_item.tsx b/app/screens/home/channel_list/servers/servers_list/server_item/server_item.tsx index 9bc78fd6cc..51168e9c82 100644 --- a/app/screens/home/channel_list/servers/servers_list/server_item/server_item.tsx +++ b/app/screens/home/channel_list/servers/servers_list/server_item/server_item.tsx @@ -152,7 +152,7 @@ const ServerItem = ({ const [switching, setSwitching] = useState(false); const [badge, setBadge] = useState({isUnread: false, mentions: 0}); const styles = getStyleSheet(theme); - const swipeable = useRef(); + const swipeable = useRef(null); const subscription = useRef(); const viewRef = useRef(null); const [showTutorial, setShowTutorial] = useState(false); @@ -372,8 +372,6 @@ const ServerItem = ({ renderRightActions={renderActions} friction={2} onSwipeableWillOpen={onSwipeableWillOpen} - - // @ts-expect-error legacy ref ref={swipeable} rightThreshold={40} > diff --git a/app/screens/interactive_dialog/index.tsx b/app/screens/interactive_dialog/index.tsx index 40a779c156..e9d6edc6e6 100644 --- a/app/screens/interactive_dialog/index.tsx +++ b/app/screens/interactive_dialog/index.tsx @@ -102,7 +102,7 @@ function InteractiveDialog({ const serverUrl = useServerUrl(); const intl = useIntl(); - const scrollView = useRef(); + const scrollView = useRef(null); const onChange = useCallback((name: string, value: string | number | boolean) => { dispatchValues({name, value}); @@ -223,8 +223,6 @@ function InteractiveDialog({ style={style.container} > diff --git a/app/screens/login/form.tsx b/app/screens/login/form.tsx index 4b6a1c456c..b49fb72795 100644 --- a/app/screens/login/form.tsx +++ b/app/screens/login/form.tsx @@ -25,7 +25,7 @@ import type {LaunchProps} from '@typings/launch'; interface LoginProps extends LaunchProps { config: Partial; - keyboardAwareRef: MutableRefObject; + keyboardAwareRef: MutableRefObject; license: Partial; numberSSOs: number; serverDisplayName: string; diff --git a/app/screens/login/index.tsx b/app/screens/login/index.tsx index 3a93540b52..c4dba14734 100644 --- a/app/screens/login/index.tsx +++ b/app/screens/login/index.tsx @@ -77,7 +77,7 @@ const LoginOptions = ({ serverDisplayName, serverUrl, ssoOptions, theme, }: LoginOptionsProps) => { const styles = getStyles(theme); - const keyboardAwareRef = useRef(); + const keyboardAwareRef = useRef(null); const dimensions = useWindowDimensions(); const isTablet = useIsTablet(); const translateX = useSharedValue(dimensions.width); @@ -199,8 +199,6 @@ const LoginOptions = ({ extraScrollHeight={0} keyboardDismissMode='on-drag' keyboardShouldPersistTaps='handled' - - // @ts-expect-error legacy ref ref={keyboardAwareRef} scrollToOverflowEnabled={true} style={styles.flex} diff --git a/app/screens/mfa/index.tsx b/app/screens/mfa/index.tsx index be91ee9fdb..a37a6f8370 100644 --- a/app/screens/mfa/index.tsx +++ b/app/screens/mfa/index.tsx @@ -97,7 +97,7 @@ const MFA = ({config, goToHome, license, loginId, password, serverDisplayName, s const dimensions = useWindowDimensions(); const translateX = useSharedValue(dimensions.width); const isTablet = useIsTablet(); - const keyboardAwareRef = useRef(); + const keyboardAwareRef = useRef(null); const intl = useIntl(); const [token, setToken] = useState(''); const [error, setError] = useState(''); @@ -197,8 +197,6 @@ const MFA = ({config, goToHome, license, loginId, password, serverDisplayName, s extraScrollHeight={0} keyboardDismissMode='on-drag' keyboardShouldPersistTaps='handled' - - // @ts-expect-error legacy ref ref={keyboardAwareRef} scrollToOverflowEnabled={true} style={styles.flex} diff --git a/app/screens/server/form.tsx b/app/screens/server/form.tsx index e22c2aed30..9285a8c651 100644 --- a/app/screens/server/form.tsx +++ b/app/screens/server/form.tsx @@ -25,7 +25,7 @@ type Props = { handleConnect: () => void; handleDisplayNameTextChanged: (text: string) => void; handleUrlTextChanged: (text: string) => void; - keyboardAwareRef: MutableRefObject; + keyboardAwareRef: MutableRefObject; theme: Theme; url?: string; urlError?: string; diff --git a/app/screens/server/index.tsx b/app/screens/server/index.tsx index e5e38a5ea1..b8b0cb305d 100644 --- a/app/screens/server/index.tsx +++ b/app/screens/server/index.tsx @@ -63,7 +63,7 @@ const Server = ({ const managedConfig = useManagedConfig(); const dimensions = useWindowDimensions(); const translateX = useSharedValue(0); - const keyboardAwareRef = useRef(); + const keyboardAwareRef = useRef(null); const [connecting, setConnecting] = useState(false); const [displayName, setDisplayName] = useState(''); const [buttonDisabled, setButtonDisabled] = useState(true); @@ -330,8 +330,6 @@ const Server = ({ extraScrollHeight={20} keyboardDismissMode='on-drag' keyboardShouldPersistTaps='handled' - - // @ts-expect-error legacy ref ref={keyboardAwareRef} scrollToOverflowEnabled={true} style={styles.flex}