fix(frontend): cancellabelTimeoutHook: clean only once
This commit is contained in:
parent
b1945a87e3
commit
d61b727f6b
1 changed files with 1 additions and 1 deletions
|
|
@ -15,6 +15,6 @@ export default function useCancelableTimeout(
|
|||
clearTimeout(idRef.current)
|
||||
onCancel()
|
||||
}
|
||||
useEffect(() => () => clearTimeout(idRef.current)) // auto-cancel without callback (clean)
|
||||
useEffect(() => () => clearTimeout(idRef.current), []) // auto-cancel without callback (on clean)
|
||||
return [ triggerTimeout, cancelTimeout ]
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue