fix: suppress exhaustive-deps warnings in multiple components

- Added eslint-disable comments for react-hooks/exhaustive-deps in CustomCollapse, DmxapiPage, SelectionActionApp, ActionGeneral, and ActionTranslate components to prevent warnings related to missing dependencies in useEffect hooks.
This commit is contained in:
kangfenmao 2025-05-28 16:24:47 +08:00
parent c8c30f327b
commit 94e6ba759e
5 changed files with 5 additions and 0 deletions

View File

@ -66,6 +66,7 @@ const CustomCollapse: FC<CustomCollapseProps> = ({
const collapseStyle = merge({}, defaultCollapseStyle, style)
const collapseItemStyles = useMemo(() => {
return merge({}, defaultCollapseItemStyles, styles)
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [activeKeys])
return (

View File

@ -348,6 +348,7 @@ const DmxapiPage: FC<{ Options: string[] }> = ({ Options }) => {
return () => {
if (spaceClickTimer.current) {
// eslint-disable-next-line react-hooks/exhaustive-deps
clearTimeout(spaceClickTimer.current)
}
}

View File

@ -55,6 +55,7 @@ const SelectionActionApp: FC = () => {
window.removeEventListener('blur', handleWindowBlur)
}
// don't need any dependencies
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])
useEffect(() => {

View File

@ -197,6 +197,7 @@ const ActionGeneral: FC<Props> = React.memo(({ action, scrollToBottom }) => {
setError(err instanceof Error ? err.message : 'An error occurred')
console.error('Error fetching result:', err)
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])
useEffect(() => {

View File

@ -76,6 +76,7 @@ const ActionTranslate: FC<Props> = ({ action, scrollToBottom }) => {
} finally {
translatingRef.current = false
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [action, targetLanguage, translateModel])
useEffect(() => {