Changelog
All notable changes to Hookstorm are documented here.
v1.1.0 — 2026-04-01
New Hooks
| Hook | Description |
|---|---|
useIntersectionObserver | Detect when an element enters or leaves the viewport |
useMediaQuery | Track whether a CSS media query matches |
useEventListener | Attach an event listener to window or any element |
useResizeObserver | Track the dimensions of a DOM element |
Improvements
| Area | Change |
|---|---|
useCookie | Syncs state when the window regains focus — picks up cookie changes made in other tabs |
useGeoLocation | Options are read via a ref inside the effect — prevents stale option values if the object reference changes between renders |
useMounted | Exports UseMountedReturn type alias for consistency with the rest of the library |
v1.0.1 — 2026-03-31
Maintenance
- Updated devDependencies to latest stable:
@typescript-eslint/*8.58,vitest+@vitest/coverage-v84.x,eslint-plugin-react-hooks7.x,jsdom29.x,release-it19.x - Disabled new
react-hooks/refsandreact-hooks/set-state-in-effectrules (v7) — patterns are intentional and documented - Fixed
vitest.config.tsinclude pattern to preventdist/test file false positives in vitest 4 - Fixed
usePrefersThemetest to usevi.stubGlobalfor jsdom 29 compatibility
v1.0.0 — 2026-03-31
First stable release. This version introduces a complete overhaul of the library's quality, tooling, and hook correctness.
New Hooks
| Hook | Description |
|---|---|
useAsync | Manage async function lifecycle with data, loading, error, and execute |
useInterval | Declarative setInterval with pause support via null delay |
useTimeout | Declarative setTimeout with reset and clear API |
useMounted | Ref-based mount guard for safe async state updates |
Bug Fixes
| Hook | Fix |
|---|---|
useCountdown | Fixed interval constantly resetting due to timeLeft in dependency array; now uses ref-based active tracking |
useLockScroll | Fixed race condition when multiple components use the hook simultaneously; replaced with module-level reference counter |
useLocalStorage / useSessionStorage | Wrapped all JSON operations in try/catch to prevent crashes on malformed data |
useCookie | Full RFC 6265 compliance; values and keys are URL-encoded; handles = in values correctly |
useCopyToClipboard | Fixed memory leak where setTimeout could call setState after component unmount |
useMousePosition / useScrollPosition | Added requestAnimationFrame throttling to prevent excessive re-renders |
useIdle | Fixed listener flood caused by inline default events array creating a new reference on every render |
useGeoLocation | Added unmount cancellation flag and enableHighAccuracy, timeout, maximumAge options; added loading state |
useWindowSize / useScrollPosition / useDocumentTitle | Added SSR safety guards (typeof window !== "undefined") |
useClickOutside | Added focusin event listener for keyboard and screen reader accessibility |
useKeyPress | Added case-insensitive key matching |
Improvements
- Interface naming — all
IuseXinterfaces renamed toUseXReturnand exported from the package root tsconfig.json— updatedjsxfrom"react"to"react-jsx"(noimport Reactneeded)package.json— addedpeerDependencies(React ≥ 18),sideEffects: false,exportsfield,description, andkeywordsindex.ts— fixed two case-sensitivity bugs that would break builds on Linux CI
Tooling
- ESLint 9 — flat config (
eslint.config.mjs) with@typescript-eslint,eslint-plugin-react-hooks,eslint-config-prettier - Prettier — added
.prettierrc - Vitest — full test suite with
jsdomenvironment; 115 tests across 26 files, 97%+ source coverage .npmignore— excludessrc/,web/,.github/, config files, and test files from the published packagerelease-it— added.release-it.jsonandCHANGELOG.mdfor automated release management- CI — added
validatejob (lint → test → build) that must pass before any publish job runs
Docs
- Migrated from Vercel to GitHub Pages (
https://gokhangunduz.github.io/hookstorm) - Added
deploy-pages.ymlworkflow for automatic deployment on push tomain - Redesigned Docusaurus theme with dark/light mode support
- Added new logo with dark mode variant and SVG favicon
- Updated README with full hook list, TypeScript types section, and usage examples
v0.0.33 and earlier
See GitHub Releases for older versions.