NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm
npm, #4486 most downloaded on npm
React hook library, ready to use, written in Typescript.
Latest stable
3.1.1
Last release 2 years ago
no release in 18 months
Ships unpredictably
gaps range from 8 days to 1.2 years
Most releases are documented
notes for 44 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
5 years old
61 releases · first in 2021
Drag across the ruler to compare, or tap a release to open it.
b1dffb9: feat: Update peerDependencies to include React 19 @michal-worwag
06dfd5e: Add remove function to useLocalStorage and useSessionStorage (@k-melnychuk & @RubyHuntsman)
remove function to useLocalStorage and useSessionStorage (@k-melnychuk & @RubyHuntsman)useTernaryDarkMode related types (@soullivaneuh)defaultValue for useBoolean (@luckrnx09)useCounter (#570 by @luckrnx09)Your coding agent can read these notes before it upgrades. Set up the MCP server →
b14db5b: Add support for focus event to useOnClickOutside (Fixes: #522)
useOnClickOutside (Fixes: #522)useEventListener (#546 by @LumaKernel)AddEventListenerOptions in useOnClickOutside (Fixes #554 from @metav-drimz)useOnClickOutside (Fixes: #531)### Patch Changes - Fix: Update exported files
a8e8968: Remove previously deprecated hooks and hooks' signatures
9b65ce8: Add id param to useScript hook (from #285 by @misidoro)
id param to useScript hook (from #285 by @misidoro)isLocked state to the useScrollLock return (#521 by @kyrylo-soulandwolf)useScrollLock in an SSR environment (#521 by @kyrylo-soulandwolf)useCountdown methods with useCallback (from #326 by @gromchen)useCounter methods with useCallback (from #326 by @gromchen)useScrollLock leaving inline styles (#516 from @novacdenis)b88cc01: fix useResizeObserver initialSize mutation (#504 from @iuriiiurevich)
useResizeObserver initialSize mutation (#504 from @iuriiiurevich)649ef39: Deprecated useLockedBody replaced by useScrollLock
useScrollLock hook (#479 by @BlankParticle)useLockedBody replaced by useScrollLockuseMediaQuery by defining getMatches before use (#494 by @ymc-maha)useScrollLock hookuseLockedBody replaced by useScrollLockuseMediaQuery by defining getMatches before usebc3f967: Deprecated useEffectOnce, useIsFirstRender and useUpdateEffect
useScreen and useWindowSizeuseEventCallbackuseFetch, see the documentation for more informationuseEffectOnce, useIsFirstRender and useUpdateEffect87a5141: Improve useOnClickOutside:
useOnClickOutside:
undefineduseIntersectionObserver API and fixed #395, #271 and #182, see #464.useElementSize replaced by useResizeObserveruseResizeObserver hookuseScript failed to remove script from cache when passing removeOnUnmount prop (#354 by @ShanSenanayake)verbatimModuleSyntax to avoid side-effectstsup as bundler instead of transpiling with tsc (@BlankParticle)useScreen is not rerendering on screen resize (#280 by @philipgher)Don't remove comments during package build to keep JSdoc comments
cb6eb5c: Added an optional option param in useDocumentTitle() to reset title on un-mount (#345 by @ladislasdellinger)
useDocumentTitle() to reset title on un-mount (#345 by @ladislasdellinger)lodash.debounce to dependencies from peerDependencies (#459 by @BlankParticle)add1431: Created useUnmount hook
useUnmount hookuseDebounceCallback and useDebounceValue hooksuseDebounce hook (replaced by useDebounceCallback or useDebounceValue){ initializeWithValue?: boolean } parameter to useLocalStorage, useReadLocalStorage, useSessionStorage, useDarkMode, useTernaryDarkMode, useMediaQuery, useScreen, useWindowSize and useElementSize, see #451.defaultValue option to useTernaryDarkMode and update its signature (using function overload for smooth migration)useDarkMode signature (using function overload for smooth migration)Map, Set and Date supports in use*Storage hooks, it isn't compatible with useReadLocalStorage making the API un-consistent. Use a custom serializer/deserializer instead.react and @testing-library/react (thanks to @TheHaff)@typescript-eslint stricter to catch bugs sooneruseImageOnLoad, too opinionatedjest to vitest (making test-suite execution 2 times faster)8f3c90f: Enable setting localStorage key for useDarkTheme & useTernaryDarkMode (#298 by @ubarbaxor)
ad0dfa5: Update useCopyToClipboard documentation (#398 by @andyjphu)
### Patch Changes - hotfix: package files missing
### Patch Changes - Fix #420
55a1904: added export map in package.json
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
fix hard-coded useLockedBody anchor id
Transpile commonjs to es5 and esm to es6 (fixes #232)
Added options in useScript (#203, #197 by @curtvict)
useToggleuseScript (#203, #197 by @curtvict)useEventListener (#194 from @modex98)import React from "react"useIntersectionObserver deps (#195 from @Guesswhoitis)Added useDocumentTitle (#218 by @curtvict)
useDocumentTitle (#218 by @curtvict)import React line (not needed since react 17)Support React 18 (#214 by @sharvit)
Simplify config files (removing some tools)
usehooks-ts to the rootSee: #208
useEventListener now supports Document events
Document eventsimprove useCountdown interface (#160 by @PabloLION)
useCountdown interface (#160 by @PabloLION)useIsClient (#161 by @createdbymahmood)Ignore unrelated 'storage' events in useLocalStorage (#153 from @bogdanailincaipnt)
Fix useFetch (#139 from @daiky218)
Memoise useBoolean (#122 from @angusd3v)
Memoise useBoolean (#122 from @angusd3v)
Improve useEventListener reactivity (#117 from @TunA-Kai)
Add unit tests on useWindowSize (#112 from @createdbymahmood)
Add unit tests on useInterval (#104/#106 from @createdbymahmood)
- Added: useTernaryDarkMode() - Fixed: ESM/CJS build See more in the changelog.
useTernaryDarkMode()See more in the changelog.
Fix esm and source map (issued (#88) by @egehandulger)
Fix types add tests on useEventListener (#82 from @egehandulger)
Add tests on useIsMounted (#75 from @DidrikLind)
Nothing published for this version
Create media query hook (#74 from @AbbalYouness)
Create useClickAnyWhere hook (#66 from @sonjoydatta)
Simplify useOnClickOutside (introduces a bug fixed in 2.0.2)
Fixing the useElementSize changes the hook interface.
Nothing published for this version
Upgrade @Material-ui to Mui@5 (including a lot of UI refactoring)
Use useEventListener in the hooks when possible #DRY.
Upgrade Node and NPM to publish quickly with lerna
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.