Skip to content

Releases: mrcaidev/hooks

v0.10.0

22 Nov 08:41
Compare
Choose a tag to compare

Breaking Changes

  • Removed defaultValue option from useLocalStorage and useSessionStorage.
  • Renamed useSelection to useTextSelection.
  • Previous useUpdateDeps is now useUpdate.
  • Previous useUpdate is now deprecated.

New Hooks

  • useDocumentEventListener: Listen to events on document.
  • useTitle: Use page title.

Bug Fixes

  • useClipboardText did not update text state on visibility changes.

v0.9.0

30 Jan 16:53
Compare
Choose a tag to compare

Features

  • Hook useAsyncEffect: Use async function in useEffect.
  • 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 to useUpdateDeps.

v0.8.1

27 Jan 12:04
Compare
Choose a tag to compare

Fixes

  • useUpdate fails in React 18 strict dev mode.

v0.8.0

27 Jan 09:07
Compare
Choose a tag to compare

Features

  • Hook useIsMounted: Check if a component is mounted.
  • Hook useWindow: Use window object.
  • Full typing support for EventMap.

Fixes

  • Use typeof document instead of typeof window to check if the current environment is browser. See this issue of Deno.

Refactors

  • Migrate to Vite and Vitest.
  • Hooks now rely on each other.
  • Require react-dom as a peer dependency.

v0.7.0

14 Oct 02:37
Compare
Choose a tag to compare

New Hooks

  • usePrevious
  • useInterval

Refactor

  • Rename useDelayEffect to useTimeout

v0.6.0

09 Oct 11:28
Compare
Choose a tag to compare

New Hooks

  • useDocument
  • useSafeLayoutEffect
  • useUnsafeOnceEffect
  • useWindowSize

Refactor

  • Hooks no longer depend on each other, allowing for copy&paste&tweak usage.
  • Tackle stale closure problem in all hooks

v0.5.0

16 Sep 04:09
Compare
Choose a tag to compare

New Hooks

  • useTitle

v0.4.1

10 Aug 15:06
Compare
Choose a tag to compare

Bug Fixes

  • Change version range of react and react-dom from "^18.2.0" to ">=16.8.0"

v0.4.0

10 Aug 13:44
Compare
Choose a tag to compare

New Hooks

  • useDebounce
  • useDebounceEffect
  • useDelayEffect
  • useEventListener
  • useLatest
  • useThrottle
  • useThrottleEffect

New Features

  • Allow native targets where ref is required, e.g. Allow HTMLElement where previously only RefObject<HTMLElement> is allowed.

Bug Fixes

  • useLocalStorage no longer fails when browser prohibits cookie and data access.

Refactors

  • Remove result interface.
  • Remove useStorage and UseStorageOptions API.

v0.3.0

04 Aug 03:27
Compare
Choose a tag to compare

New Hooks

  • useFocusTrap