Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent Debouncing Behavior with useDebounce Hook #188

Open
Qodestackr opened this issue Oct 17, 2024 · 1 comment
Open

Inconsistent Debouncing Behavior with useDebounce Hook #188

Qodestackr opened this issue Oct 17, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Qodestackr
Copy link

Describe the bug
The useDebounce hook causes inconsistent updates when value equality is customized. Specifically, the hook fails to correctly debounce values when equalityFn is provided, leading to premature or delayed state updates.

To Reproduce

  1. Implement useDebounce with a custom equalityFn.
  2. Change the value.
  3. Observe that updates may either not debounce properly or trigger multiple renders.

Expected behavior
Debouncing should respect the equalityFn and delay updates consistently.

use-debounce version:
:latest

@xnimorz
Copy link
Owner

xnimorz commented Oct 19, 2024

Hello @Qodestackr
I'd appreciate if you share repro example, using https://codesandbox.io/ or so
It would allow me to quicker triage the problem and fix it.

Thanks

@xnimorz xnimorz added the bug Something isn't working label Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants