Skip to content

Commit 159f567

Browse files
committed
fix: #703 Unstable options object in useDebounceCallback breaks debouncing
1 parent 556bfcc commit 159f567

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/usehooks-ts/src/useDebounceCallback/useDebounceCallback.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,12 @@ export function useDebounceCallback<T extends (...args: any) => ReturnType<T>>(
104104
}
105105

106106
return wrappedFunc
107-
}, [func, delay, options])
107+
}, [func, delay])
108108

109109
// Update the debounced function ref whenever func, wait, or options change
110110
useEffect(() => {
111111
debouncedFunc.current = debounce(func, delay, options)
112-
}, [func, delay, options])
112+
}, [func, delay])
113113

114114
return debounced
115115
}

0 commit comments

Comments
 (0)