Releases: mrcaidev/hooks
Releases · mrcaidev/hooks
v0.10.0
Breaking Changes
- Removed
defaultValue
option fromuseLocalStorage
anduseSessionStorage
. - Renamed
useSelection
touseTextSelection
. - Previous
useUpdateDeps
is nowuseUpdate
. - Previous
useUpdate
is now deprecated.
New Hooks
useDocumentEventListener
: Listen to events ondocument
.useTitle
: Use page title.
Bug Fixes
useClipboardText
did not update text state on visibility changes.
v0.9.0
Features
- Hook
useAsyncEffect
: Use async function inuseEffect
. - Hook
useClipboardText
: Manage text content on clipboard. - Hook
useSelection
: Responds to user's text selection. - Hook
useUpdate
: Trigger effect after the component is updated.
Refactors
- Rename
useUpdate
touseUpdateDeps
.
v0.8.1
v0.8.0
Features
- Hook
useIsMounted
: Check if a component is mounted. - Hook
useWindow
: Usewindow
object. - Full typing support for
EventMap
.
Fixes
- Use
typeof document
instead oftypeof window
to check if the current environment is browser. See this issue of Deno.
Refactors
- Migrate to
Vite
andVitest
. - Hooks now rely on each other.
- Require
react-dom
as a peer dependency.
v0.7.0
v0.6.0
v0.5.0
v0.4.1
v0.4.0
New Hooks
- useDebounce
- useDebounceEffect
- useDelayEffect
- useEventListener
- useLatest
- useThrottle
- useThrottleEffect
New Features
- Allow native targets where
ref
is required, e.g. AllowHTMLElement
where previously onlyRefObject<HTMLElement>
is allowed.
Bug Fixes
useLocalStorage
no longer fails when browser prohibits cookie and data access.
Refactors
- Remove result interface.
- Remove
useStorage
andUseStorageOptions
API.