React hook library, ready to use, written in Typescript.
MIT License
Bot releases are hidden (Show)
remove
function to useLocalStorage
and useSessionStorage
(@k-melnychuk & @RubyHuntsman)useTernaryDarkMode
related types (@soullivaneuh)defaultValue
for useBoolean
(@luckrnx09)useCounter
(#570 by @luckrnx09)useOnClickOutside
(Fixes: #522)useEventListener
(#546 by @LumaKernel)AddEventListenerOptions
in useOnClickOutside
(Fixes #554 from @metav-drimz)useOnClickOutside
(Fixes: #531)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)useScrollLock
hook (#479 by @BlankParticle)useLockedBody
replaced by useScrollLock
useMediaQuery
by defining getMatches
before use (#494 by @ymc-maha)useScreen
and useWindowSize
useEventCallback
useFetch
, see the documentation for more informationuseEffectOnce
, useIsFirstRender
and useUpdateEffect
useOnClickOutside
:
undefined
useIntersectionObserver
API and fixed #395, #271 and #182, see #464.useElementSize
replaced by useResizeObserver
useResizeObserver
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)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)useToggle
useScript
(#203, #197 by @curtvict)useEventListener
(#194 from @modex98)import React from "react"
useIntersectionObserver
deps (#195 from @Guesswhoitis)