diff --git a/config/eslint/eslint.seatbelt.tsv b/config/eslint/eslint.seatbelt.tsv index 06d32c1029af..3071e820f709 100644 --- a/config/eslint/eslint.seatbelt.tsv +++ b/config/eslint/eslint.seatbelt.tsv @@ -486,7 +486,7 @@ "../../src/pages/inbox/report/ListBoundaryLoader.tsx" "react-hooks/set-state-in-effect" 1 "../../src/pages/inbox/report/PureReportActionItem.tsx" "react-hooks/set-state-in-effect" 1 "../../src/pages/inbox/report/ReactionList/HeaderReactionList.tsx" "no-restricted-syntax" 1 -"../../src/pages/inbox/report/ReportActionCompose/ComposerWithSuggestions.tsx" "@typescript-eslint/no-deprecated/InteractionManager.runAfterInteractions" 1 +"../../src/pages/inbox/report/ReportActionCompose/ComposerWithSuggestions.tsx" "no-restricted-imports" 1 "../../src/pages/inbox/report/ReportActionCompose/ComposerWithSuggestions.tsx" "react-hooks/refs" 7 "../../src/pages/inbox/report/ReportActionCompose/SuggestionEmoji.tsx" "react-hooks/refs" 1 "../../src/pages/inbox/report/ReportActionCompose/SuggestionMention.tsx" "react-hooks/refs" 3 diff --git a/src/pages/inbox/report/ReportActionCompose/ComposerWithSuggestions.tsx b/src/pages/inbox/report/ReportActionCompose/ComposerWithSuggestions.tsx index 432ac45da15e..9e86665d99f1 100644 --- a/src/pages/inbox/report/ReportActionCompose/ComposerWithSuggestions.tsx +++ b/src/pages/inbox/report/ReportActionCompose/ComposerWithSuggestions.tsx @@ -11,8 +11,7 @@ import type { TextInputKeyPressEvent, TextInputScrollEvent, } from 'react-native'; -// eslint-disable-next-line no-restricted-imports -import {DeviceEventEmitter, InteractionManager, NativeModules, StyleSheet, View} from 'react-native'; +import {DeviceEventEmitter, NativeModules, StyleSheet, View} from 'react-native'; import {useFocusedInputHandler} from 'react-native-keyboard-controller'; import {useAnimatedRef, useSharedValue} from 'react-native-reanimated'; import type {Emoji} from '@assets/emojis/types'; @@ -42,6 +41,7 @@ import type {Selection} from '@libs/focusComposerWithDelay/types'; import type {ForwardedFSClassProps} from '@libs/Fullstory/types'; import {addKeyDownPressListener, removeKeyDownPressListener} from '@libs/KeyboardShortcut/KeyDownPressListener'; import {detectAndRewritePaste} from '@libs/MarkdownLinkHelpers'; +import TransitionTracker from '@libs/Navigation/TransitionTracker'; import Parser from '@libs/Parser'; import ReportActionComposeFocusManager from '@libs/ReportActionComposeFocusManager'; import {isValidReportIDFromPath, shouldAutoFocusOnKeyPress} from '@libs/ReportUtils'; @@ -750,12 +750,10 @@ function ComposerWithSuggestions({ } delayedAutoFocusRouteKeyRef.current = route.key; - const task = InteractionManager.runAfterInteractions(() => { - focus(true); - }); + const handle = TransitionTracker.runAfterTransitions({callback: () => focus(true)}); return () => { - task?.cancel?.(); + handle.cancel(); }; }, [focus, route.key, shouldAutoFocus, shouldDelayAutoFocus]);