Skip to content

Deprecate useDebounce and useThrottle in favor of the Callback hooks #537

Open

Description

@hyesungoh

useDebounce and useThrottle return a wrapped function, but the names do not say so, and other hook libraries use the same names for hooks that return a debounced or throttled value. useDebouncedCallback and useThrottledCallback cannot replace them yet, because they forward a single value and have no cancel.

  • Let useDebouncedCallback and useThrottledCallback wrap a function with any arguments and return it with cancel.
  • Mark useDebounce and useThrottle as deprecated and point their docs to the Callback hooks.
  • useImpressionRef relies on the Callback hook skipping a repeated call with the same value. Keep that behavior, either in the Callback hook or in useImpressionRef.

Update types, docs, and tests.

Waits for #530 and #534.

Activity

  1. Antoliny0919 commented on Sep 30, 2026

    @Antoliny0919
    Contributor

    I’m a little worried I might be claiming too many issues, but since I’ve already offered to work on the dependencies, it probably makes sense for me to take this one too. 🥲

  2. Antoliny0919 commented on Oct 6, 2026

    @Antoliny0919
    Contributor

    https://github.com/toss/react-simplikit/pull/545/changes -> I'll get started once this change is in!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions