mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-24 10:40:07 +08:00
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:
parent
c8c30f327b
commit
94e6ba759e
@ -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 (
|
||||
|
||||
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@ -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(() => {
|
||||
|
||||
@ -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(() => {
|
||||
|
||||
@ -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(() => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user