Repository navigation
v4.0.0
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
useClickOutsidenow defaults to not escaping the referenced element(s) unlessescape: trueis explicitly passed.- The debounce/throttle family of hooks has been updated with symmetric naming and
useDebounceanduseThrottlehave been deprecated in favor ofuseDebouncedCallbackanduseThrottledValue.
Minor Changes
- Added retry logic for attaching event listeners to null targets.
- Added human-friendly key aliases to the
use-key-presshook. - Added support for function refs that return their own cleanup, improving compatibility with React 19.
- Added support for custom box sizing to the
useResizeObserverhook.
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