You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Callback would be saved in ref. And as docs said, it is wrapped by useCallback. But what happen if dependencies changes? throttled.current may not change, because it only changes when [fn, wait, options] change with effect hook.
It seems memoization does not consider dependencies. Please let me know if it's wrong. Anyway useCallback works, but I want awesome useThrottledCallback that u guys made 👍
Desktop (please complete the following information):
OS: macos bigsur
Browser chrome
Version 1.2.0
The text was updated successfully, but these errors were encountered:
Describe the bug
It seems
useThrottledCallback
doesn't consider dependencies array.To Reproduce
I used
useThrottledCallback
with dependencymode
.If
mode
change, callback(first parameter) must change insideuseThrottledCallback
, but it doesn't.Expected behavior
Expected to consider variable inside dependencies. I guess there is one problem in
useThrottledCallback
. Here is source.Callback would be saved in ref. And as docs said, it is wrapped by
useCallback
. But what happen if dependencies changes?throttled.current
may not change, because it only changes when[fn, wait, options]
change with effect hook.It seems memoization does not consider dependencies. Please let me know if it's wrong. Anyway
useCallback
works, but I want awesomeuseThrottledCallback
that u guys made 👍Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: