Skip to content

Inconsistent Debouncing Behavior with useDebounce Hook #188

@Qodestackr

Description

@Qodestackr

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions