This repository has been archived by the owner on Jul 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
useEffect to clearTimeout dependency array? #3
Labels
bug
Something isn't working
Comments
Hey @crobinson42. I have to be honest, I wrote this hook some time ago when my experience on React was not so high. Anyway, thanks to having pointed out that issue. I'll try to resolve it as soon as possible if you need it. |
DrugoLebowski
added a commit
that referenced
this issue
Jun 11, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 11, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 11, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 11, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 11, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 11, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 11, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 11, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 11, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 11, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 11, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 11, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 12, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 12, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 12, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 12, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 12, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 12, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 12, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 12, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 12, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 12, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 13, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 13, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 13, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 13, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 14, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 14, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 14, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 14, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 14, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 14, 2020
Merged
DrugoLebowski
added a commit
that referenced
this issue
Jun 14, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 14, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 14, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 14, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 14, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 14, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 14, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 14, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 14, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 14, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 14, 2020
DrugoLebowski
added a commit
that referenced
this issue
Jun 14, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Why is the hook not using the dependency array 2nd arg in
useEffect
here: https://github.com/DrugoLebowski/use-throttled-callback/blob/develop/src/use-throttled-callback.ts#L42I think what you want is this:
When you omit the 2nd arg in
useEffect
, you are clearing the timeout every time the hook is fired (including when components and parent components re-render)The text was updated successfully, but these errors were encountered: