Skip to content

v4.0.0

Choose a tag to compare

@github-actions github-actions released this 12 Aug 13:15
· 150 commits to main since this release
fd44628

Release Notes for @jbpark/use-hooks v4.0.0

This release brings significant improvements to the useClickOutside, use-key-press, useResizeObserver, and debounce/throttle family of hooks, along with minor bug fixes and enhancements.

Major Changes

  • useClickOutside now defaults to not escaping the referenced element(s) unless escape: true is explicitly passed.
  • The debounce/throttle family of hooks has been updated with symmetric naming and useDebounce and useThrottle have been deprecated in favor of useDebouncedCallback and useThrottledValue.

Minor Changes

  • Added retry logic for attaching event listeners to null targets.
  • Added human-friendly key aliases to the use-key-press hook.
  • Added support for function refs that return their own cleanup, improving compatibility with React 19.
  • Added support for custom box sizing to the useResizeObserver hook.

What's Changed

  • 🐛 fix: key changeset drafting off branch slug, not any-file-exists by @pjb0811 in #138
  • 🐛 fix: match the space key in useKeyPress and add key aliases by @pjb0811 in #147
  • 🐛 fix: release every ref on detach in useMergedRef by @pjb0811 in #149
  • 🐛 fix: react to box option changes and guard empty box sizes in useResizeObserver by @pjb0811 in #150
  • 🐛 fix: retry late-filled ref targets in observer/listener hooks by @pjb0811 in #151
  • 📝 docs: document all 30 hooks and add a v2 → v3 migration guide by @pjb0811 in #152
  • ♻️ refactor: symmetric debounce/throttle naming with back-compat aliases by @pjb0811 in #153
  • 🐛 fix: make useClickOutside's escape handling opt-in (default false) by @pjb0811 in #154
  • 🔖 chore: version packages by @github-actions[bot] in #148

Full Changelog: v3.0.0...v4.0.0