unstale

npm / ahooks

ahooks

What changed in ahooks 3, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-28.

2 breaking5 new APIs and options1 performance4 behavior and defaults24 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.2.9 on npm

ahooks 336 changes

Breaking changes 2

  • Removes the deprecated dependency.

    3.10.0release notes

  • Cancelled or superseded calls now reject with CancelledError instead of remaining pending; callers should catch errors and use isCancelledError to distinguish cancellation from service errors.

    3.10.0release notes

New APIs and options 5

  • The third argument accepts an options object with enabled to control whether outside-click listeners are attached; existing event-name string and array arguments remain supported.

    3.11.0release notes

  • Exported for identifying cancellation rejections from useRequest asynchronous calls.

    3.10.0release notes

  • Exported so callers can distinguish cancellation from service errors.

    3.10.0release notes

  • Defers storage reads until after mount to avoid SSR hydration mismatches.

    3.10.0release notes

  • Enables useAntdTable to support ProForm's transform through the form instance.

    3.10.0release notes

Performance 1

  • Prevents unnecessary re-renders when the storage state remains the same.

    3.9.7release notes

Behavior and default changes 4

  • Supports synchronous cleanup functions, which React runs when dependencies change and on unmount; cleanup returned from an async callback remains unsupported.

    3.10.0release notes

  • Can be used without an initial state; the returned state is typed as Partial<T>.

    3.10.0release notes

  • Uses requestAnimationFrame to update scroll position.

    3.9.7release notes

  • Adds legacy key aliases for compatibility.

    3.9.7release notes

Fixes and other changes 24

  • Preserves configured Cookie attributes, including path and domain, when removing Cookies.

    3.11.0release notes

  • Preserves 0, false, and empty strings while continuing to filter out null and undefined.

    3.11.0release notes

  • Infers resource types correctly for URLs with queries or fragments and preserves the original element URLs.

    3.11.0release notes

  • Infers resource types correctly for URLs with queries or fragments and preserves the original element URLs.

    3.11.0release notes

  • Preserves history during batched updates, navigation, and updates following a reset.

    3.11.0release notes

  • Prevents repeated automatic requests after an empty page and defers bottom checks until loading state updates complete.

    3.11.0release notes

  • Clears loadingMore when cancelling requests, allowing subsequent button and scroll loading while ignoring cancelled responses and callbacks.

    3.11.0release notes

  • Rechecks whether more data is needed when the scroll container or viewport changes size, without treating the initial resize notification as a resize.

    3.11.0release notes

  • Invokes the latest callback while preserving native arguments and receiver, without recreating the observer when the callback changes.

    3.11.0release notes

  • Preserves function-valued state instead of invoking the value as a state updater during initialization or reset.

    3.11.0release notes

  • Recomputes selection maps and flags when the key property or callback changes.

    3.11.0release notes

  • Avoids accessing browser storage during server rendering.

    3.11.0release notes

  • Fixes debounce leading behavior that could affect subsequent requests while ready=false.

    3.10.0release notes

  • Fixes calls that did not work in throttled scenarios.

    3.10.0release notes

  • Fixes compatibility between explicit generics and ref targets.

    3.10.0release notes

  • Preserves non-nullable ref return types.

    3.10.0release notes

  • Fixes stale data captured during the initial loadMore call.

    3.10.0release notes

  • Fixes modifier-key keyup matching when exact matching is enabled.

    3.10.0release notes

  • Fixes Pointer Events support.

    3.10.0release notes

  • Fixes type inference for default parameters.

    3.10.0release notes

  • Clears related timers when request cache entries are deleted.

    3.10.0release notes

  • Falls back to legacy media query listeners for older Safari versions.

    3.10.0release notes

  • Fixes clear not taking effect when called inside the execution function.

    3.9.7release notes

  • Fixes runAsync not returning immediately when ready=false and there is no pending state.

    3.9.7release notes